20 sfc_files_input_grid, &
21 nst_files_input_grid, &
26 ip1_input, jp1_input, &
31 landsea_mask_input_grid
38 type(esmf_field
),
public :: c_d_input_grid
39 type(esmf_field),
public :: c_0_input_grid
40 type(esmf_field),
public :: d_conv_input_grid
41 type(esmf_field),
public :: dt_cool_input_grid
42 type(esmf_field),
public :: ifd_input_grid
45 type(esmf_field
),
public :: qrain_input_grid
46 type(esmf_field),
public :: tref_input_grid
47 type(esmf_field),
public :: w_d_input_grid
48 type(esmf_field),
public :: w_0_input_grid
49 type(esmf_field),
public :: xs_input_grid
50 type(esmf_field),
public :: xt_input_grid
51 type(esmf_field),
public :: xu_input_grid
52 type(esmf_field),
public :: xv_input_grid
53 type(esmf_field),
public :: xz_input_grid
54 type(esmf_field),
public :: xtts_input_grid
55 type(esmf_field),
public :: xzts_input_grid
56 type(esmf_field),
public :: z_c_input_grid
57 type(esmf_field),
public :: zm_input_grid
71 integer,
intent(in) :: localpet
75 print*,
"- READ INPUT GRID NST DATA."
77 print*,
"- CALL FieldCreate FOR INPUT GRID C_D."
78 c_d_input_grid = esmf_fieldcreate(input_grid, &
79 typekind=esmf_typekind_r8, &
80 staggerloc=esmf_staggerloc_center, rc=rc)
81 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
84 print*,
"- CALL FieldCreate FOR INPUT GRID C_0."
85 c_0_input_grid = esmf_fieldcreate(input_grid, &
86 typekind=esmf_typekind_r8, &
87 staggerloc=esmf_staggerloc_center, rc=rc)
88 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
91 print*,
"- CALL FieldCreate FOR INPUT GRID D_CONV."
92 d_conv_input_grid = esmf_fieldcreate(input_grid, &
93 typekind=esmf_typekind_r8, &
94 staggerloc=esmf_staggerloc_center, rc=rc)
95 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
98 print*,
"- CALL FieldCreate FOR INPUT GRID DT_COOL."
99 dt_cool_input_grid = esmf_fieldcreate(input_grid, &
100 typekind=esmf_typekind_r8, &
101 staggerloc=esmf_staggerloc_center, rc=rc)
102 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
105 print*,
"- CALL FieldCreate FOR INPUT GRID IFD."
106 ifd_input_grid = esmf_fieldcreate(input_grid, &
107 typekind=esmf_typekind_r8, &
108 staggerloc=esmf_staggerloc_center, rc=rc)
109 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
112 print*,
"- CALL FieldCreate FOR INPUT GRID QRAIN."
113 qrain_input_grid = esmf_fieldcreate(input_grid, &
114 typekind=esmf_typekind_r8, &
115 staggerloc=esmf_staggerloc_center, rc=rc)
116 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
119 print*,
"- CALL FieldCreate FOR INPUT GRID TREF."
120 tref_input_grid = esmf_fieldcreate(input_grid, &
121 typekind=esmf_typekind_r8, &
122 staggerloc=esmf_staggerloc_center, rc=rc)
123 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
126 print*,
"- CALL FieldCreate FOR INPUT GRID W_D."
127 w_d_input_grid = esmf_fieldcreate(input_grid, &
128 typekind=esmf_typekind_r8, &
129 staggerloc=esmf_staggerloc_center, rc=rc)
130 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
133 print*,
"- CALL FieldCreate FOR INPUT GRID W_0."
134 w_0_input_grid = esmf_fieldcreate(input_grid, &
135 typekind=esmf_typekind_r8, &
136 staggerloc=esmf_staggerloc_center, rc=rc)
137 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
140 print*,
"- CALL FieldCreate FOR INPUT GRID XS."
141 xs_input_grid = esmf_fieldcreate(input_grid, &
142 typekind=esmf_typekind_r8, &
143 staggerloc=esmf_staggerloc_center, rc=rc)
144 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
147 print*,
"- CALL FieldCreate FOR INPUT GRID XT."
148 xt_input_grid = esmf_fieldcreate(input_grid, &
149 typekind=esmf_typekind_r8, &
150 staggerloc=esmf_staggerloc_center, rc=rc)
151 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
154 print*,
"- CALL FieldCreate FOR INPUT GRID XU."
155 xu_input_grid = esmf_fieldcreate(input_grid, &
156 typekind=esmf_typekind_r8, &
157 staggerloc=esmf_staggerloc_center, rc=rc)
158 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
161 print*,
"- CALL FieldCreate FOR INPUT GRID XV."
162 xv_input_grid = esmf_fieldcreate(input_grid, &
163 typekind=esmf_typekind_r8, &
164 staggerloc=esmf_staggerloc_center, rc=rc)
165 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
168 print*,
"- CALL FieldCreate FOR INPUT GRID XZ."
169 xz_input_grid = esmf_fieldcreate(input_grid, &
170 typekind=esmf_typekind_r8, &
171 staggerloc=esmf_staggerloc_center, rc=rc)
172 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
175 print*,
"- CALL FieldCreate FOR INPUT GRID XTTS."
176 xtts_input_grid = esmf_fieldcreate(input_grid, &
177 typekind=esmf_typekind_r8, &
178 staggerloc=esmf_staggerloc_center, rc=rc)
179 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
182 print*,
"- CALL FieldCreate FOR INPUT GRID XZTS."
183 xzts_input_grid = esmf_fieldcreate(input_grid, &
184 typekind=esmf_typekind_r8, &
185 staggerloc=esmf_staggerloc_center, rc=rc)
186 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
189 print*,
"- CALL FieldCreate FOR INPUT GRID Z_C."
190 z_c_input_grid = esmf_fieldcreate(input_grid, &
191 typekind=esmf_typekind_r8, &
192 staggerloc=esmf_staggerloc_center, rc=rc)
193 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
196 print*,
"- CALL FieldCreate FOR INPUT GRID ZM."
197 zm_input_grid = esmf_fieldcreate(input_grid, &
198 typekind=esmf_typekind_r8, &
199 staggerloc=esmf_staggerloc_center, rc=rc)
200 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
208 if (trim(input_type) ==
"gaussian_nemsio" .or. trim(input_type) ==
"gfs_gaussian_nemsio")
then
234 integer,
intent(in) :: localpet
236 character(len=10) :: field
240 real(esmf_kind_r8),
allocatable :: data_one_tile(:,:)
242 if (localpet == 0)
then
243 allocate(data_one_tile(i_input,j_input))
245 allocate(data_one_tile(0,0))
248 tile_loop :
do tile = 1, num_tiles_input_grid
252 if (localpet == 0)
then
253 if (trim(input_type) ==
"restart")
then
259 lsoil_input, sfcdata=data_one_tile)
262 print*,
"- CALL FieldScatter FOR INPUT C_D"
263 call esmf_fieldscatter(c_d_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
264 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
269 if (localpet == 0)
then
270 if (trim(input_type) ==
"restart")
then
276 lsoil_input, sfcdata=data_one_tile)
279 print*,
"- CALL FieldScatter FOR INPUT C_0"
280 call esmf_fieldscatter(c_0_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
281 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
286 if (localpet == 0)
then
287 if (trim(input_type) ==
"restart")
then
293 lsoil_input, sfcdata=data_one_tile)
296 print*,
"- CALL FieldScatter FOR INPUT D_CONV."
297 call esmf_fieldscatter(d_conv_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
298 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
303 if (localpet == 0)
then
304 if (trim(input_type) ==
"restart")
then
310 lsoil_input, sfcdata=data_one_tile)
313 print*,
"- CALL FieldScatter FOR INPUT DT_COOL."
314 call esmf_fieldscatter(dt_cool_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
315 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
320 if (localpet == 0)
then
324 print*,
"- CALL FieldScatter FOR INPUT IFD."
325 call esmf_fieldscatter(ifd_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
326 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
331 if (localpet == 0)
then
333 lsoil_input, sfcdata=data_one_tile)
336 print*,
"- CALL FieldScatter FOR INPUT QRAIN."
337 call esmf_fieldscatter(qrain_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
338 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
343 if (localpet == 0)
then
345 lsoil_input, sfcdata=data_one_tile)
348 print*,
"- CALL FieldScatter FOR INPUT TREF"
349 call esmf_fieldscatter(tref_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
350 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
355 if (localpet == 0)
then
356 if (trim(input_type) ==
"restart")
then
362 lsoil_input, sfcdata=data_one_tile)
365 print*,
"- CALL FieldScatter FOR INPUT W_D"
366 call esmf_fieldscatter(w_d_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
367 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
372 if (localpet == 0)
then
373 if (trim(input_type) ==
"restart")
then
379 lsoil_input, sfcdata=data_one_tile)
382 print*,
"- CALL FieldScatter FOR INPUT W_0"
383 call esmf_fieldscatter(w_0_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
384 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
389 if (localpet == 0)
then
391 lsoil_input, sfcdata=data_one_tile)
394 print*,
"- CALL FieldScatter FOR INPUT XS"
395 call esmf_fieldscatter(xs_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
396 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
401 if (localpet == 0)
then
403 lsoil_input, sfcdata=data_one_tile)
406 print*,
"- CALL FieldScatter FOR INPUT XT"
407 call esmf_fieldscatter(xt_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
408 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
413 if (localpet == 0)
then
415 lsoil_input, sfcdata=data_one_tile)
418 print*,
"- CALL FieldScatter FOR INPUT XU"
419 call esmf_fieldscatter(xu_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
420 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
425 if (localpet == 0)
then
427 lsoil_input, sfcdata=data_one_tile)
430 print*,
"- CALL FieldScatter FOR INPUT XV"
431 call esmf_fieldscatter(xv_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
432 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
437 if (localpet == 0)
then
439 lsoil_input, sfcdata=data_one_tile)
442 print*,
"- CALL FieldScatter FOR INPUT XZ"
443 call esmf_fieldscatter(xz_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
444 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
449 if (localpet == 0)
then
451 lsoil_input, sfcdata=data_one_tile)
454 print*,
"- CALL FieldScatter FOR INPUT XTTS"
455 call esmf_fieldscatter(xtts_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
456 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
461 if (localpet == 0)
then
463 lsoil_input, sfcdata=data_one_tile)
466 print*,
"- CALL FieldScatter FOR INPUT XZTS"
467 call esmf_fieldscatter(xzts_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
468 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
473 if (localpet == 0)
then
474 if (trim(input_type) ==
"restart")
then
480 lsoil_input, sfcdata=data_one_tile)
483 print*,
"- CALL FieldScatter FOR INPUT Z_C"
484 call esmf_fieldscatter(z_c_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
485 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
490 if (localpet == 0)
then
494 print*,
"- CALL FieldScatter FOR INPUT ZM"
495 call esmf_fieldscatter(zm_input_grid, data_one_tile, rootpet=0, tile=tile, rc=rc)
496 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
501 deallocate(data_one_tile)
518 integer,
intent(in) :: localpet
520 character(len=300) :: the_file
524 real(nemsio_realkind),
allocatable :: dummy(:)
525 real(esmf_kind_r8),
allocatable :: dummy2d(:,:)
527 type(nemsio_gfile
) :: gfile
529 if (trim(input_type) ==
"gfs_gaussian_nemsio")
then
531 the_file = trim(data_dir_input_grid) //
"/" // trim(nst_files_input_grid)
533 the_file = trim(data_dir_input_grid) //
"/" // trim(sfc_files_input_grid(1))
536 print*,
"- READ NST DATA FROM: ", trim(the_file)
538 if (localpet == 0)
then
539 allocate(dummy(i_input*j_input))
540 allocate(dummy2d(i_input,j_input))
541 call nemsio_open(gfile, the_file,
"read", iret=rc)
544 allocate(dummy2d(0,0))
547 if (localpet == 0)
then
549 call nemsio_readrecv(gfile,
"tref",
"sfc", 1, dummy, 0, iret=rc)
551 dummy2d = reshape(dummy, (/i_input,j_input/))
552 print*,
'tref ',maxval(dummy2d),minval(dummy2d)
555 print*,
"- CALL FieldScatter FOR INPUT TREF."
556 call esmf_fieldscatter(tref_input_grid, dummy2d, rootpet=0, rc=rc)
557 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
560 if (localpet == 0)
then
562 call nemsio_readrecv(gfile,
"cd",
"sfc", 1, dummy, 0, iret=rc)
564 dummy2d = reshape(dummy, (/i_input,j_input/))
565 print*,
'cd ',maxval(dummy2d),minval(dummy2d)
568 print*,
"- CALL FieldScatter FOR INPUT C_D."
569 call esmf_fieldscatter(c_d_input_grid, dummy2d, rootpet=0, rc=rc)
570 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
573 if (localpet == 0)
then
575 call nemsio_readrecv(gfile,
"c0",
"sfc", 1, dummy, 0, iret=rc)
577 dummy2d = reshape(dummy, (/i_input,j_input/))
578 print*,
'c0 ',maxval(dummy2d),minval(dummy2d)
581 print*,
"- CALL FieldScatter FOR INPUT C_0."
582 call esmf_fieldscatter(c_0_input_grid, dummy2d, rootpet=0, rc=rc)
583 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
586 if (localpet == 0)
then
587 print*,
"- READ DCONV"
588 call nemsio_readrecv(gfile,
"dconv",
"sfc", 1, dummy, 0, iret=rc)
590 dummy2d = reshape(dummy, (/i_input,j_input/))
591 print*,
'dconv ',maxval(dummy2d),minval(dummy2d)
594 print*,
"- CALL FieldScatter FOR INPUT D_CONV."
595 call esmf_fieldscatter(d_conv_input_grid, dummy2d, rootpet=0, rc=rc)
596 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
599 if (localpet == 0)
then
600 print*,
"- READ DTCOOL"
601 call nemsio_readrecv(gfile,
"dtcool",
"sfc", 1, dummy, 0, iret=rc)
603 dummy2d = reshape(dummy, (/i_input,j_input/))
604 print*,
'dtcool ',maxval(dummy2d),minval(dummy2d)
607 print*,
"- CALL FieldScatter FOR INPUT DT_COOL."
608 call esmf_fieldscatter(dt_cool_input_grid, dummy2d, rootpet=0, rc=rc)
609 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
612 if (localpet == 0)
then
616 print*,
"- CALL FieldScatter FOR INPUT IFD."
617 call esmf_fieldscatter(ifd_input_grid, dummy2d, rootpet=0, rc=rc)
618 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
621 if (localpet == 0)
then
622 print*,
"- READ QRAIN"
623 call nemsio_readrecv(gfile,
"qrain",
"sfc", 1, dummy, 0, iret=rc)
625 dummy2d = reshape(dummy, (/i_input,j_input/))
626 print*,
'qrain ',maxval(dummy2d),minval(dummy2d)
629 print*,
"- CALL FieldScatter FOR INPUT QRAIN."
630 call esmf_fieldscatter(qrain_input_grid, dummy2d, rootpet=0, rc=rc)
631 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
634 if (localpet == 0)
then
636 call nemsio_readrecv(gfile,
"wd",
"sfc", 1, dummy, 0, iret=rc)
638 dummy2d = reshape(dummy, (/i_input,j_input/))
639 print*,
'wd ',maxval(dummy2d),minval(dummy2d)
642 print*,
"- CALL FieldScatter FOR INPUT WD."
643 call esmf_fieldscatter(w_d_input_grid, dummy2d, rootpet=0, rc=rc)
644 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
647 if (localpet == 0)
then
649 call nemsio_readrecv(gfile,
"w0",
"sfc", 1, dummy, 0, iret=rc)
651 dummy2d = reshape(dummy, (/i_input,j_input/))
652 print*,
'w0 ',maxval(dummy2d),minval(dummy2d)
655 print*,
"- CALL FieldScatter FOR INPUT W0."
656 call esmf_fieldscatter(w_0_input_grid, dummy2d, rootpet=0, rc=rc)
657 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
660 if (localpet == 0)
then
662 call nemsio_readrecv(gfile,
"xs",
"sfc", 1, dummy, 0, iret=rc)
664 dummy2d = reshape(dummy, (/i_input,j_input/))
665 print*,
'xs ',maxval(dummy2d),minval(dummy2d)
668 print*,
"- CALL FieldScatter FOR INPUT XS."
669 call esmf_fieldscatter(xs_input_grid, dummy2d, rootpet=0, rc=rc)
670 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
673 if (localpet == 0)
then
675 call nemsio_readrecv(gfile,
"xt",
"sfc", 1, dummy, 0, iret=rc)
677 dummy2d = reshape(dummy, (/i_input,j_input/))
678 print*,
'xt ',maxval(dummy2d),minval(dummy2d)
681 print*,
"- CALL FieldScatter FOR INPUT XT."
682 call esmf_fieldscatter(xt_input_grid, dummy2d, rootpet=0, rc=rc)
683 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
686 if (localpet == 0)
then
688 call nemsio_readrecv(gfile,
"xu",
"sfc", 1, dummy, 0, iret=rc)
690 dummy2d = reshape(dummy, (/i_input,j_input/))
691 print*,
'xu ',maxval(dummy2d),minval(dummy2d)
694 print*,
"- CALL FieldScatter FOR INPUT XU."
695 call esmf_fieldscatter(xu_input_grid, dummy2d, rootpet=0, rc=rc)
696 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
699 if (localpet == 0)
then
701 call nemsio_readrecv(gfile,
"xv",
"sfc", 1, dummy, 0, iret=rc)
703 dummy2d = reshape(dummy, (/i_input,j_input/))
704 print*,
'xv ',maxval(dummy2d),minval(dummy2d)
707 print*,
"- CALL FieldScatter FOR INPUT XV."
708 call esmf_fieldscatter(xv_input_grid, dummy2d, rootpet=0, rc=rc)
709 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
712 if (localpet == 0)
then
714 call nemsio_readrecv(gfile,
"xz",
"sfc", 1, dummy, 0, iret=rc)
716 dummy2d = reshape(dummy, (/i_input,j_input/))
717 print*,
'xz ',maxval(dummy2d),minval(dummy2d)
720 print*,
"- CALL FieldScatter FOR INPUT XZ."
721 call esmf_fieldscatter(xz_input_grid, dummy2d, rootpet=0, rc=rc)
722 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
725 if (localpet == 0)
then
727 call nemsio_readrecv(gfile,
"xtts",
"sfc", 1, dummy, 0, iret=rc)
729 dummy2d = reshape(dummy, (/i_input,j_input/))
730 print*,
'xtts ',maxval(dummy2d),minval(dummy2d)
733 print*,
"- CALL FieldScatter FOR INPUT XTTS."
734 call esmf_fieldscatter(xtts_input_grid, dummy2d, rootpet=0, rc=rc)
735 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
738 if (localpet == 0)
then
740 call nemsio_readrecv(gfile,
"xzts",
"sfc", 1, dummy, 0, iret=rc)
742 dummy2d = reshape(dummy, (/i_input,j_input/))
743 print*,
'xzts ',maxval(dummy2d),minval(dummy2d)
746 print*,
"- CALL FieldScatter FOR INPUT XZTS."
747 call esmf_fieldscatter(xzts_input_grid, dummy2d, rootpet=0, rc=rc)
748 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
751 if (localpet == 0)
then
753 call nemsio_readrecv(gfile,
"zc",
"sfc", 1, dummy, 0, iret=rc)
755 dummy2d = reshape(dummy, (/i_input,j_input/))
756 print*,
'zc ',maxval(dummy2d),minval(dummy2d)
759 print*,
"- CALL FieldScatter FOR INPUT Z_C."
760 call esmf_fieldscatter(z_c_input_grid, dummy2d, rootpet=0, rc=rc)
761 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
764 if (localpet == 0)
then
768 print*,
"- CALL FieldScatter FOR INPUT ZM."
769 call esmf_fieldscatter(zm_input_grid, dummy2d, rootpet=0, rc=rc)
770 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
773 deallocate(dummy, dummy2d)
775 if (localpet == 0) call nemsio_close(gfile)
788 print*,
'- DESTROY NST INPUT DATA.'
790 call esmf_fielddestroy(landsea_mask_input_grid, rc=rc)
791 call esmf_fielddestroy(c_d_input_grid, rc=rc)
792 call esmf_fielddestroy(c_0_input_grid, rc=rc)
793 call esmf_fielddestroy(d_conv_input_grid, rc=rc)
794 call esmf_fielddestroy(dt_cool_input_grid, rc=rc)
795 call esmf_fielddestroy(ifd_input_grid, rc=rc)
796 call esmf_fielddestroy(qrain_input_grid, rc=rc)
797 call esmf_fielddestroy(tref_input_grid, rc=rc)
798 call esmf_fielddestroy(w_d_input_grid, rc=rc)
799 call esmf_fielddestroy(w_0_input_grid, rc=rc)
800 call esmf_fielddestroy(xs_input_grid, rc=rc)
801 call esmf_fielddestroy(xt_input_grid, rc=rc)
802 call esmf_fielddestroy(xu_input_grid, rc=rc)
803 call esmf_fielddestroy(xv_input_grid, rc=rc)
804 call esmf_fielddestroy(xz_input_grid, rc=rc)
805 call esmf_fielddestroy(xtts_input_grid, rc=rc)
806 call esmf_fielddestroy(xzts_input_grid, rc=rc)
807 call esmf_fielddestroy(z_c_input_grid, rc=rc)
808 call esmf_fielddestroy(zm_input_grid, rc=rc)
Sets up the ESMF grid objects for the input data grid and target FV3 grid.
subroutine error_handler(string, rc)
General error handler.
This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data...