49 use write_data,
only : write_fv3_sfc_data_netcdf
51 use utilities,
only : error_handler
73 real,
parameter,
private ::
blim = 5.5
75 real,
parameter,
private ::
frz_h2o = 273.15
77 real,
parameter,
private ::
frz_ice = 271.21
79 real,
parameter,
private ::
grav = 9.81
81 real,
parameter,
private ::
hlice = 3.335e5
84 real(esmf_kind_r8),
parameter,
private ::
missing = -1.e20_esmf_kind_r8
89 real(esmf_kind_r8),
pointer :: p(:,:)
94 real(esmf_kind_r8),
pointer :: p(:,:,:)
116 use sfc_input_data,
only : cleanup_input_sfc_data, &
119 use nst_input_data,
only : cleanup_input_nst_data, &
130 use utilities,
only : error_handler
134 integer,
intent(in) :: localpet
152 call read_input_sfc_data(localpet)
158 if (
convert_nst)
call read_input_nst_data(localpet)
225 call cleanup_input_sfc_data
239 call write_fv3_sfc_data_netcdf(localpet)
261 subroutine interp(localpet)
266 use sfc_input_data,
only : canopy_mc_input_grid, &
269 landsea_mask_input_grid, &
271 seaice_depth_input_grid, &
272 seaice_fract_input_grid, &
273 seaice_skin_temp_input_grid, &
274 skin_temp_input_grid, &
275 snow_depth_input_grid, &
276 snow_liq_equiv_input_grid, &
277 soil_temp_input_grid, &
278 soil_type_input_grid, &
279 soilm_tot_input_grid, &
284 veg_type_input_grid, &
286 veg_type_landice_input, &
287 veg_greenness_input_grid, &
288 max_veg_greenness_input_grid, &
289 min_veg_greenness_input_grid, &
292 use nst_input_data,
only : c_d_input_grid, &
295 dt_cool_input_grid, &
340 integer,
intent(in) :: localpet
342 integer :: l(1), u(1)
343 integer :: i, j, ij, rc, tile
344 integer :: clb_target(2), cub_target(2)
345 integer :: isrctermprocessing
346 integer :: num_fields
347 integer :: vgfrc_ind, mmvg_ind, lai_ind
348 integer,
allocatable :: search_nums(:)
349 integer(esmf_kind_i4),
pointer :: unmapped_ptr(:)
350 integer(esmf_kind_i4),
pointer :: mask_input_ptr(:,:)
351 integer(esmf_kind_i4),
pointer :: mask_target_ptr(:,:)
352 integer(esmf_kind_i8),
pointer :: landmask_target_ptr(:,:)
353 integer(esmf_kind_i8),
allocatable :: mask_target_one_tile(:,:)
354 integer(esmf_kind_i8),
allocatable :: water_target_one_tile(:,:)
355 integer(esmf_kind_i8),
allocatable :: land_target_one_tile(:,:)
356 integer(esmf_kind_i8),
pointer :: seamask_target_ptr(:,:)
358 real(esmf_kind_r8),
allocatable :: data_one_tile(:,:)
359 real(esmf_kind_r8),
allocatable :: data_one_tile2(:,:)
360 real(esmf_kind_r8),
allocatable :: data_one_tile_3d(:,:,:)
361 real(esmf_kind_r8),
allocatable :: latitude_one_tile(:,:)
362 real(esmf_kind_r8),
allocatable :: fice_target_one_tile(:,:)
363 real(esmf_kind_r8),
pointer :: seaice_fract_target_ptr(:,:)
364 real(esmf_kind_r8),
pointer :: srflag_target_ptr(:,:)
365 real(esmf_kind_r8),
pointer :: terrain_from_input_ptr(:,:)
366 real(esmf_kind_r8),
pointer :: veg_type_target_ptr(:,:)
367 real(esmf_kind_r8),
pointer :: soil_type_target_ptr(:,:)
368 real(esmf_kind_r8),
pointer :: landmask_input_ptr(:,:)
369 real(esmf_kind_r8),
pointer :: veg_type_input_ptr(:,:)
370 real(esmf_kind_r8),
allocatable :: veg_type_target_one_tile(:,:)
371 real(esmf_kind_r8) :: ice_lim
373 type(esmf_regridmethod_flag) :: method
374 type(esmf_routehandle) :: regrid_bl_no_mask
375 type(esmf_routehandle) :: regrid_all_land
376 type(esmf_routehandle) :: regrid_land
377 type(esmf_routehandle) :: regrid_landice
378 type(esmf_routehandle) :: regrid_nonland
379 type(esmf_routehandle) :: regrid_seaice
380 type(esmf_routehandle) :: regrid_water
382 type(esmf_fieldbundle) :: bundle_all_target, bundle_all_input
383 type(esmf_fieldbundle) :: bundle_seaice_target, bundle_seaice_input
384 type(esmf_fieldbundle) :: bundle_water_target, bundle_water_input
385 type(esmf_fieldbundle) :: bundle_allland_target, bundle_allland_input
386 type(esmf_fieldbundle) :: bundle_landice_target, bundle_landice_input
387 type(esmf_fieldbundle) :: bundle_nolandice_target, bundle_nolandice_input
389 logical,
allocatable :: dozero(:)
395 method=esmf_regridmethod_bilinear
397 isrctermprocessing = 1
399 print*,
"- CALL FieldRegridStore FOR NON-MASKED BILINEAR INTERPOLATION." 400 call esmf_fieldregridstore(t2m_input_grid, &
402 polemethod=esmf_polemethod_allavg, &
403 srctermprocessing=isrctermprocessing, &
404 routehandle=regrid_bl_no_mask, &
405 regridmethod=method, rc=rc)
406 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
407 call error_handler(
"IN FieldRegridStore", rc)
409 bundle_all_target = esmf_fieldbundlecreate(name=
"all points target", rc=rc)
410 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
411 call error_handler(
"IN FieldBundleCreate", rc)
412 bundle_all_input = esmf_fieldbundlecreate(name=
"all points input", rc=rc)
413 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
414 call error_handler(
"IN FieldBundleCreate", rc)
419 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
420 call error_handler(
"IN FieldBundleAdd", rc)
421 call esmf_fieldbundleadd(bundle_all_input, (/t2m_input_grid,q2m_input_grid,tprcp_input_grid, &
422 f10m_input_grid,ffmm_input_grid,ustar_input_grid,srflag_input_grid/), &
424 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
425 call error_handler(
"IN FieldBundleAdd", rc)
427 call esmf_fieldbundleget(bundle_all_target,fieldcount=num_fields,rc=rc)
428 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
429 call error_handler(
"IN FieldBundleGet", rc)
431 allocate(dozero(num_fields))
434 call regrid_many(bundle_all_input,bundle_all_target,num_fields,regrid_bl_no_mask,dozero)
437 call esmf_fieldbundledestroy(bundle_all_target,rc=rc)
438 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
439 call error_handler(
"IN FieldBundleDestroy", rc)
440 call esmf_fieldbundledestroy(bundle_all_input,rc=rc)
441 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
442 call error_handler(
"IN FieldBundleDestroy", rc)
444 print*,
"- CALL FieldGet FOR SRFLAG." 446 farrayptr=srflag_target_ptr, rc=rc)
447 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
448 call error_handler(
"IN FieldGet", rc)
455 srflag_target_ptr = nint(srflag_target_ptr)
457 print*,
"- CALL FieldRegridRelease." 458 call esmf_fieldregridrelease(routehandle=regrid_bl_no_mask, rc=rc)
459 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
460 call error_handler(
"IN FieldRegridRelease", rc)
466 print*,
"- CALL GridAddItem FOR TARGET GRID." 468 itemflag=esmf_griditem_mask, &
469 staggerloc=esmf_staggerloc_center, rc=rc)
470 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
471 call error_handler(
"IN GridAddItem", rc)
473 print*,
"- CALL GridGetItem FOR TARGET GRID." 475 itemflag=esmf_griditem_mask, &
476 farrayptr=mask_target_ptr, rc=rc)
477 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
478 call error_handler(
"IN GridGetItem", rc)
480 print*,
"- CALL FieldGet FOR TARGET GRID SEAMASK." 482 computationallbound=clb_target, &
483 computationalubound=cub_target, &
484 farrayptr=seamask_target_ptr, rc=rc)
485 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
486 call error_handler(
"IN FieldGet", rc)
488 print*,
"- CALL FieldGet FOR TARGET GRID LANDMASK." 490 farrayptr=landmask_target_ptr, rc=rc)
491 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
492 call error_handler(
"IN FieldGet", rc)
494 print*,
"- CALL GridAddItem FOR INPUT GRID SEAMASK." 496 itemflag=esmf_griditem_mask, &
497 staggerloc=esmf_staggerloc_center, rc=rc)
498 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
499 call error_handler(
"IN GridAddItem", rc)
501 print*,
"- CALL FieldGet FOR INPUT GRID LANDMASK." 502 call esmf_fieldget(landsea_mask_input_grid, &
503 farrayptr=landmask_input_ptr, rc=rc)
504 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
505 call error_handler(
"IN FieldGet", rc)
507 print*,
"- CALL GridGetItem FOR INPUT GRID LANDMASK." 509 itemflag=esmf_griditem_mask, &
510 farrayptr=mask_input_ptr, rc=rc)
511 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
512 call error_handler(
"IN GridGetItem", rc)
514 if (localpet == 0)
then 519 allocate(data_one_tile(0,0))
520 allocate(data_one_tile_3d(0,0,0))
521 allocate(mask_target_one_tile(0,0))
529 method=esmf_regridmethod_nearest_stod
531 isrctermprocessing = 1
534 where (nint(landmask_input_ptr) == 1) mask_input_ptr = 1
537 where (landmask_target_ptr == 1) mask_target_ptr = 1
539 print*,
"- CALL FieldCreate FOR TERRAIN FROM INPUT GRID LAND." 541 typekind=esmf_typekind_r8, &
542 staggerloc=esmf_staggerloc_center, rc=rc)
543 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
544 call error_handler(
"IN FieldCreate", rc)
546 print*,
"- CALL FieldRegridStore for land fields." 549 srcmaskvalues=(/0/), &
550 dstmaskvalues=(/0/), &
551 polemethod=esmf_polemethod_none, &
552 srctermprocessing=isrctermprocessing, &
553 unmappedaction=esmf_unmappedaction_ignore, &
554 normtype=esmf_normtype_fracarea, &
555 routehandle=regrid_all_land, &
556 regridmethod=method, &
557 unmappeddstlist=unmapped_ptr, rc=rc)
558 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
559 call error_handler(
"IN FieldRegridStore", rc)
561 print*,
"- CALL Field_Regrid TERRAIN." 564 routehandle=regrid_all_land, &
565 termorderflag=esmf_termorder_srcseq, rc=rc)
566 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
567 call error_handler(
"IN FieldRegrid", rc)
569 print*,
"- CALL FieldGet FOR terrain from input grid at land." 571 farrayptr=terrain_from_input_ptr, rc=rc)
572 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
573 call error_handler(
"IN FieldGet", rc)
575 l = lbound(unmapped_ptr)
576 u = ubound(unmapped_ptr)
580 terrain_from_input_ptr(i,j) = -9999.9
582 nullify(terrain_from_input_ptr)
586 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
588 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
589 call error_handler(
"IN FieldGather", rc)
591 print*,
"- CALL FieldGather FOR TERRAIN FROM INPUT GRID: ", tile
593 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
594 call error_handler(
"IN FieldGather", rc)
596 if (localpet == 0)
then 598 land_target_one_tile = 0
599 where(mask_target_one_tile == 1) land_target_one_tile = 1
601 deallocate(land_target_one_tile)
604 print*,
"- CALL FieldScatter FOR TERRAIN FROM INPUT GRID: ", tile
606 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
607 call error_handler(
"IN FieldScatter", rc)
612 print*,
"- CALL FieldRegrid VEG TYPE." 613 call esmf_fieldregrid(veg_type_input_grid, &
615 routehandle=regrid_all_land, &
616 termorderflag=esmf_termorder_srcseq, rc=rc)
617 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
618 call error_handler(
"IN FieldRegrid", rc)
620 print*,
"- CALL FieldGet FOR TARGET grid veg type." 622 farrayptr=veg_type_target_ptr, rc=rc)
623 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
624 call error_handler(
"IN FieldGet", rc)
626 l = lbound(unmapped_ptr)
627 u = ubound(unmapped_ptr)
631 veg_type_target_ptr(i,j) = -9999.9
635 print*,
"- CALL FieldGather FOR TARGET GRID VEG TYPE TILE: ", tile
637 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
638 call error_handler(
"IN FieldGather", rc)
640 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
642 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
643 call error_handler(
"IN FieldGather", rc)
645 if (localpet == 0)
then 647 land_target_one_tile = 0
648 where(mask_target_one_tile == 1) land_target_one_tile = 1
650 deallocate(land_target_one_tile)
653 print*,
"- CALL FieldScatter FOR TARGET GRID VEG TYPE: ", tile
655 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
656 call error_handler(
"IN FieldScatter", rc)
658 nullify(veg_type_target_ptr)
661 print*,
"- CALL FieldRegridRelease." 662 call esmf_fieldregridrelease(routehandle=regrid_all_land, rc=rc)
663 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
664 call error_handler(
"IN FieldRegridRelease", rc)
674 where (nint(landmask_input_ptr) == 1) mask_input_ptr = 0
681 mask_target_ptr = int(seamask_target_ptr,kind=esmf_kind_i4)
683 method=esmf_regridmethod_conserve
685 isrctermprocessing = 1
687 print*,
"- CALL FieldRegridStore for sea ice fraction." 688 call esmf_fieldregridstore(seaice_fract_input_grid, &
690 srcmaskvalues=(/0/), &
691 dstmaskvalues=(/0/), &
692 polemethod=esmf_polemethod_none, &
693 srctermprocessing=isrctermprocessing, &
694 unmappedaction=esmf_unmappedaction_ignore, &
695 normtype=esmf_normtype_fracarea, &
696 routehandle=regrid_nonland, &
697 regridmethod=method, &
698 unmappeddstlist=unmapped_ptr, rc=rc)
699 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
700 call error_handler(
"IN FieldRegridStore", rc)
702 print*,
"- CALL Field_Regrid for sea ice fraction." 703 call esmf_fieldregrid(seaice_fract_input_grid, &
705 routehandle=regrid_nonland, &
706 termorderflag=esmf_termorder_srcseq, rc=rc)
707 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
708 call error_handler(
"IN FieldRegrid", rc)
710 print*,
"- CALL FieldGet FOR TARGET grid sea ice fraction." 712 farrayptr=seaice_fract_target_ptr, rc=rc)
713 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
714 call error_handler(
"IN FieldGet", rc)
716 l = lbound(unmapped_ptr)
717 u = ubound(unmapped_ptr)
721 seaice_fract_target_ptr(i,j) = -9999.9
726 if (localpet == 0)
then 729 allocate(latitude_one_tile(0,0))
734 print*,
"- CALL FieldGather FOR TARGET GRID SEAICE FRACTION TILE: ", tile
736 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
737 call error_handler(
"IN FieldGather", rc)
739 print*,
"- CALL FieldGather FOR TARGET GRID MASK TILE: ", tile
740 call esmf_fieldgather(
seamask_target_grid, mask_target_one_tile, rootpet=0, tile=tile, rc=rc)
741 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
742 call error_handler(
"IN FieldGather", rc)
744 print*,
"- CALL FieldGather FOR TARGET LATITUDE TILE: ", tile
746 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
747 call error_handler(
"IN FieldGather", rc)
749 if (localpet == 0)
then 751 latitude=latitude_one_tile)
759 ice_lim = 0.95_esmf_kind_r8
761 if (localpet == 0)
then 764 if (data_one_tile(i,j) > ice_lim)
then 765 data_one_tile(i,j) = 1.0_esmf_kind_r8
767 if (data_one_tile(i,j) < 0.15_esmf_kind_r8) data_one_tile(i,j) = 0.0_esmf_kind_r8
772 print*,
"- CALL FieldScatter FOR TARGET GRID SEAICE FRACTION TILE: ", tile
774 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
775 call error_handler(
"IN FieldScatter", rc)
779 deallocate(latitude_one_tile)
781 print*,
"- CALL FieldRegridRelease." 782 call esmf_fieldregridrelease(routehandle=regrid_nonland, rc=rc)
783 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
784 call error_handler(
"IN FieldRegridRelease", rc)
792 where (nint(landmask_input_ptr) == 2) mask_input_ptr = 1
795 do j = clb_target(2), cub_target(2)
796 do i = clb_target(1), cub_target(1)
797 if (seaice_fract_target_ptr(i,j) > 0.0) mask_target_ptr(i,j) = 1
801 method=esmf_regridmethod_nearest_stod
802 isrctermprocessing = 1
804 print*,
"- CALL FieldRegridStore for 3d seaice fields." 805 call esmf_fieldregridstore(soil_temp_input_grid, &
807 srcmaskvalues=(/0/), &
808 dstmaskvalues=(/0/), &
809 polemethod=esmf_polemethod_none, &
810 srctermprocessing=isrctermprocessing, &
811 unmappedaction=esmf_unmappedaction_ignore, &
812 normtype=esmf_normtype_fracarea, &
813 routehandle=regrid_seaice, &
814 regridmethod=method, &
815 unmappeddstlist=unmapped_ptr, rc=rc)
817 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
818 call error_handler(
"IN FieldRegridStore", rc)
820 bundle_seaice_target = esmf_fieldbundlecreate(name=
"sea ice target", rc=rc)
821 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
822 call error_handler(
"IN FieldBundleCreate", rc)
823 bundle_seaice_input = esmf_fieldbundlecreate(name=
"sea ice input", rc=rc)
824 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
825 call error_handler(
"IN FieldBundleCreate", rc)
831 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
832 call error_handler(
"IN FieldBundleAdd", rc)
834 call esmf_fieldbundleadd(bundle_seaice_input, (/seaice_depth_input_grid, snow_depth_input_grid, &
835 snow_liq_equiv_input_grid, seaice_skin_temp_input_grid, &
836 soil_temp_input_grid/), rc=rc)
837 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
838 call error_handler(
"IN FieldBundleAdd", rc)
840 call esmf_fieldbundleget(bundle_seaice_target,fieldcount=num_fields,rc=rc)
841 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
842 call error_handler(
"IN FieldBundleGet", rc)
844 allocate(search_nums(num_fields))
845 allocate(dozero(num_fields))
847 search_nums = (/92,66,65,21,21/)
850 l = lbound(unmapped_ptr)
851 u = ubound(unmapped_ptr)
853 call regrid_many(bundle_seaice_input,bundle_seaice_target,num_fields,regrid_seaice,dozero, &
854 unmapped_ptr=unmapped_ptr )
856 call esmf_fieldbundledestroy(bundle_seaice_input,rc=rc)
857 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
858 call error_handler(
"IN FieldBundleDestroy", rc)
860 if (localpet == 0)
then 863 allocate(fice_target_one_tile(0,0))
868 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
870 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
871 call error_handler(
"IN FieldGather", rc)
873 if (localpet == 0)
then 874 mask_target_one_tile = 0
875 where(fice_target_one_tile > 0.0) mask_target_one_tile = 1
876 call search_many(num_fields,bundle_seaice_target,tile, search_nums,localpet, &
877 mask=mask_target_one_tile)
879 call search_many(num_fields,bundle_seaice_target, tile,search_nums,localpet)
884 deallocate(search_nums)
886 call esmf_fieldbundledestroy(bundle_seaice_target,rc=rc)
887 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
888 call error_handler(
"IN FieldBundleDestroy", rc)
890 print*,
"- CALL FieldRegridRelease." 891 call esmf_fieldregridrelease(routehandle=regrid_seaice, rc=rc)
892 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
893 call error_handler(
"IN FieldRegridRelease", rc)
900 where (nint(landmask_input_ptr) == 0) mask_input_ptr = 1
907 where (seamask_target_ptr == 1) mask_target_ptr = 1
908 where (seaice_fract_target_ptr == 1.0_esmf_kind_r8) mask_target_ptr = 0
910 method=esmf_regridmethod_conserve
911 isrctermprocessing = 1
913 print*,
"- CALL FieldRegridStore for water fields." 914 call esmf_fieldregridstore(skin_temp_input_grid, &
916 srcmaskvalues=(/0/), &
917 dstmaskvalues=(/0/), &
918 polemethod=esmf_polemethod_none, &
919 srctermprocessing=isrctermprocessing, &
920 unmappedaction=esmf_unmappedaction_ignore, &
921 normtype=esmf_normtype_fracarea, &
922 routehandle=regrid_water, &
923 regridmethod=method, &
924 unmappeddstlist=unmapped_ptr, rc=rc)
925 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
926 call error_handler(
"IN FieldRegridStore", rc)
928 bundle_water_target = esmf_fieldbundlecreate(name=
"water target", rc=rc)
929 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
930 call error_handler(
"IN FieldBundleCreate", rc)
931 bundle_water_input = esmf_fieldbundlecreate(name=
"water input", rc=rc)
932 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
933 call error_handler(
"IN FieldBundleCreate", rc)
937 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
938 call error_handler(
"IN FieldBundleAdd", rc)
940 call esmf_fieldbundleadd(bundle_water_input, (/skin_temp_input_grid, z0_input_grid/), rc=rc)
941 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
942 call error_handler(
"IN FieldBundleAdd", rc)
951 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
952 call error_handler(
"IN FieldBundleAdd", rc)
954 call esmf_fieldbundleadd(bundle_water_input, (/c_d_input_grid,c_0_input_grid,d_conv_input_grid, &
955 dt_cool_input_grid,ifd_input_grid,qrain_input_grid,tref_input_grid, &
956 w_d_input_grid,w_0_input_grid,xs_input_grid,xt_input_grid,xu_input_grid, &
957 xv_input_grid,xz_input_grid,xtts_input_grid,xzts_input_grid, &
958 z_c_input_grid,zm_input_grid/), rc=rc)
959 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
960 call error_handler(
"IN FieldBundleAdd", rc)
961 call esmf_fieldbundleget(bundle_water_target,fieldcount=num_fields,rc=rc)
962 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
963 call error_handler(
"IN FieldBundleGet", rc)
965 allocate(search_nums(num_fields))
966 allocate(dozero(num_fields))
968 search_nums(:)=(/11,83,0,0,0,0,1,0,11,0,0,0,0,0,0,30,0,0,0,0/)
972 call esmf_fieldbundleget(bundle_water_target,fieldcount=num_fields,rc=rc)
973 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
974 call error_handler(
"IN FieldBundleGet", rc)
976 allocate(search_nums(num_fields))
977 allocate(dozero(num_fields))
978 search_nums(:)=(/11,83/)
982 call regrid_many(bundle_water_input,bundle_water_target,num_fields,regrid_water,dozero, &
983 unmapped_ptr=unmapped_ptr, resetifd=.true.)
985 call esmf_fieldbundledestroy(bundle_water_input,rc=rc)
986 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
987 call error_handler(
"IN FieldBundleDestroy", rc)
990 if (localpet == 0)
then 993 allocate(latitude_one_tile(0,0))
998 print*,
"- CALL FieldGather FOR TARGET SEAMASK TILE: ", tile
999 call esmf_fieldgather(
seamask_target_grid, mask_target_one_tile, rootpet=0, tile=tile, rc=rc)
1000 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1001 call error_handler(
"IN FieldGather", rc)
1003 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
1005 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1006 call error_handler(
"IN FieldGather", rc)
1008 print*,
"- CALL FieldGather FOR TARGET LATITUDE TILE: ", tile
1010 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1011 call error_handler(
"IN FieldGather", rc)
1014 if (localpet == 0)
then 1016 water_target_one_tile = 0
1017 where(mask_target_one_tile == 1) water_target_one_tile = 1
1018 where(fice_target_one_tile == 1.0_esmf_kind_r8) water_target_one_tile = 0
1019 call search_many(num_fields,bundle_water_target, tile,search_nums,localpet, &
1020 latitude=latitude_one_tile,mask=water_target_one_tile)
1022 call search_many(num_fields,bundle_water_target, tile,search_nums,localpet)
1025 if (localpet == 0)
deallocate(water_target_one_tile)
1029 deallocate(latitude_one_tile,search_nums,fice_target_one_tile)
1031 call esmf_fieldbundledestroy(bundle_water_target,rc=rc)
1032 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1033 call error_handler(
"IN FieldBundleDestroy", rc)
1035 print*,
"- CALL FieldRegridRelease." 1036 call esmf_fieldregridrelease(routehandle=regrid_water, rc=rc)
1037 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1038 call error_handler(
"IN FieldRegridRelease", rc)
1045 where (nint(landmask_input_ptr) == 1) mask_input_ptr = 1
1048 where (landmask_target_ptr == 1) mask_target_ptr = 1
1050 method=esmf_regridmethod_conserve
1051 isrctermprocessing = 1
1053 print*,
"- CALL FieldRegridStore for land fields." 1054 call esmf_fieldregridstore(snow_depth_input_grid, &
1056 srcmaskvalues=(/0/), &
1057 dstmaskvalues=(/0/), &
1058 polemethod=esmf_polemethod_none, &
1059 srctermprocessing=isrctermprocessing, &
1060 unmappedaction=esmf_unmappedaction_ignore, &
1061 normtype=esmf_normtype_fracarea, &
1062 routehandle=regrid_all_land, &
1063 regridmethod=method, &
1064 unmappeddstlist=unmapped_ptr, rc=rc)
1065 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1066 call error_handler(
"IN FieldRegridStore", rc)
1068 bundle_allland_target = esmf_fieldbundlecreate(name=
"all land target", rc=rc)
1069 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1070 call error_handler(
"IN FieldBundleCreate", rc)
1071 bundle_allland_input = esmf_fieldbundlecreate(name=
"all land input", rc=rc)
1072 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1073 call error_handler(
"IN FieldBundleCreate", rc)
1076 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1077 call error_handler(
"IN FieldBundleAdd", rc)
1078 call esmf_fieldbundleadd(bundle_allland_input, (/snow_depth_input_grid, &
1079 snow_liq_equiv_input_grid/), rc=rc)
1080 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1081 call error_handler(
"IN FieldBundleAdd", rc)
1082 call esmf_fieldbundleget(bundle_allland_target,fieldcount=num_fields,rc=rc)
1083 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1084 call error_handler(
"IN FieldBundleGet", rc)
1086 allocate(search_nums(num_fields))
1087 allocate(dozero(num_fields))
1089 search_nums = (/66,65/)
1090 dozero=(/.false.,.false./)
1092 call regrid_many(bundle_allland_input,bundle_allland_target,num_fields,regrid_all_land,dozero, &
1093 unmapped_ptr=unmapped_ptr)
1095 call esmf_fieldbundledestroy(bundle_allland_input,rc=rc)
1096 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1097 call error_handler(
"IN FieldBundleDestroy", rc)
1101 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
1103 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1104 call error_handler(
"IN FieldGather", rc)
1106 if (localpet == 0)
then 1108 land_target_one_tile = 0
1109 where(mask_target_one_tile == 1) land_target_one_tile = 1
1111 call search_many(num_fields,bundle_allland_target, &
1112 tile,search_nums,localpet, mask=land_target_one_tile)
1114 call search_many(num_fields,bundle_allland_target, tile,search_nums,localpet)
1117 if (localpet == 0)
deallocate(land_target_one_tile)
1120 deallocate(search_nums)
1121 call esmf_fieldbundledestroy(bundle_allland_target,rc=rc)
1122 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1123 call error_handler(
"IN FieldBundleDestroy", rc)
1125 print*,
"- CALL FieldRegridRelease." 1126 call esmf_fieldregridrelease(routehandle=regrid_all_land, rc=rc)
1127 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1128 call error_handler(
"IN FieldRegridRelease", rc)
1134 print*,
"- CALL FieldGet FOR INPUT GRID VEG TYPE." 1135 call esmf_fieldget(veg_type_input_grid, &
1136 farrayptr=veg_type_input_ptr, rc=rc)
1137 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1138 call error_handler(
"IN FieldGet", rc)
1141 where (nint(veg_type_input_ptr) == veg_type_landice_input) mask_input_ptr = 1
1143 print*,
"- CALL FieldGet FOR TARGET GRID VEG TYPE." 1145 farrayptr=veg_type_target_ptr, rc=rc)
1146 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1147 call error_handler(
"IN FieldGet", rc)
1152 method=esmf_regridmethod_nearest_stod
1153 isrctermprocessing = 1
1155 print*,
"- CALL FieldRegridStore for landice fields." 1156 call esmf_fieldregridstore(soil_temp_input_grid, &
1158 srcmaskvalues=(/0/), &
1159 dstmaskvalues=(/0/), &
1160 polemethod=esmf_polemethod_none, &
1161 srctermprocessing=isrctermprocessing, &
1162 unmappedaction=esmf_unmappedaction_ignore, &
1163 normtype=esmf_normtype_fracarea, &
1164 routehandle=regrid_landice, &
1165 regridmethod=method, &
1166 unmappeddstlist=unmapped_ptr, rc=rc)
1167 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1168 call error_handler(
"IN FieldRegridStore", rc)
1170 bundle_landice_target = esmf_fieldbundlecreate(name=
"landice target", rc=rc)
1171 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1172 call error_handler(
"IN FieldBundleCreate", rc)
1173 bundle_landice_input = esmf_fieldbundlecreate(name=
"landice input", rc=rc)
1174 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1175 call error_handler(
"IN FieldBundleCreate", rc)
1178 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1179 call error_handler(
"IN FieldBundleAdd", rc)
1180 call esmf_fieldbundleadd(bundle_landice_input, (/skin_temp_input_grid,
terrain_input_grid,&
1181 soil_temp_input_grid/), rc=rc)
1182 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1183 call error_handler(
"IN FieldBundleAdd", rc)
1186 call esmf_fieldbundleadd(bundle_landice_input, (/soil_type_input_grid/),rc=rc)
1187 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1188 call error_handler(
"IN FieldBundleAdd", rc)
1190 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1191 call error_handler(
"IN FieldBundleAdd", rc)
1194 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1195 call error_handler(
"IN FieldBundleAdd", rc)
1196 call esmf_fieldbundleget(bundle_landice_target,fieldcount=num_fields,rc=rc)
1197 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1198 call error_handler(
"IN FieldBundleGet", rc)
1200 allocate(search_nums(num_fields))
1201 allocate(dozero(num_fields))
1204 search_nums = (/21,7,21/)
1207 search_nums = (/21,7,21,231/)
1208 dozero(:)=(/.false.,.false.,.false.,.true./)
1211 call regrid_many(bundle_landice_input,bundle_landice_target,num_fields,regrid_landice,dozero, &
1212 unmapped_ptr=unmapped_ptr )
1214 call esmf_fieldbundledestroy(bundle_landice_input,rc=rc)
1215 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1216 call error_handler(
"IN FieldBundleDestroy", rc)
1218 if (localpet == 0)
then 1223 allocate (veg_type_target_one_tile(0,0))
1224 allocate (land_target_one_tile(0,0))
1225 allocate (data_one_tile2(0,0))
1229 print*,
"- CALL FieldGather FOR TARGET VEG TYPE TILE: ", tile
1230 call esmf_fieldgather(
veg_type_target_grid, veg_type_target_one_tile, rootpet=0, tile=tile, rc=rc)
1231 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1232 call error_handler(
"IN FieldGather", rc)
1234 if (localpet == 0)
then 1235 land_target_one_tile = 0
1239 print*,
"- CALL FieldGather FOR TERRAIN FROM INPUT GRID LAND, TILE: ", tile
1241 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1242 call error_handler(
"IN FieldGather", rc)
1244 if (localpet==0)
then 1245 call search_many(num_fields,bundle_landice_target,tile,search_nums,localpet,&
1246 terrain_land=data_one_tile2,mask=land_target_one_tile)
1248 call search_many(num_fields,bundle_landice_target,tile,search_nums,localpet)
1252 deallocate (veg_type_target_one_tile)
1253 deallocate (land_target_one_tile)
1254 deallocate(search_nums)
1256 call esmf_fieldbundledestroy(bundle_landice_target,rc=rc)
1257 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1258 call error_handler(
"IN FieldBundleDestroy", rc)
1260 print*,
"- CALL FieldRegridRelease." 1261 call esmf_fieldregridrelease(routehandle=regrid_landice, rc=rc)
1262 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1263 call error_handler(
"IN FieldRegridRelease", rc)
1270 where (nint(landmask_input_ptr) == 1) mask_input_ptr = 1
1271 where (nint(veg_type_input_ptr) == veg_type_landice_input) mask_input_ptr = 0
1274 where (landmask_target_ptr == 1) mask_target_ptr = 1
1277 method=esmf_regridmethod_nearest_stod
1278 isrctermprocessing = 1
1280 print*,
"- CALL FieldRegridStore for 3d land (but no land ice) fields." 1281 call esmf_fieldregridstore(soilm_tot_input_grid, &
1283 srcmaskvalues=(/0/), &
1284 dstmaskvalues=(/0/), &
1285 polemethod=esmf_polemethod_none, &
1286 srctermprocessing=isrctermprocessing, &
1287 unmappedaction=esmf_unmappedaction_ignore, &
1288 normtype=esmf_normtype_fracarea, &
1289 routehandle=regrid_land, &
1290 regridmethod=method, &
1291 unmappeddstlist=unmapped_ptr, rc=rc)
1292 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1293 call error_handler(
"IN FieldRegridStore", rc)
1295 bundle_nolandice_target = esmf_fieldbundlecreate(name=
"land no landice target", rc=rc)
1296 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1297 call error_handler(
"IN FieldBundleCreate", rc)
1299 bundle_nolandice_input = esmf_fieldbundlecreate(name=
"land no landice input", rc=rc)
1300 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1301 call error_handler(
"IN FieldBundleCreate", rc)
1306 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1307 call error_handler(
"IN FieldBundleAdd", rc)
1309 call esmf_fieldbundleadd(bundle_nolandice_input, (/skin_temp_input_grid,
terrain_input_grid,&
1310 soil_type_input_grid,soilm_tot_input_grid,soil_temp_input_grid,&
1311 canopy_mc_input_grid/), rc=rc)
1312 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1313 call error_handler(
"IN FieldBundleAdd", rc)
1317 print*,
"- CALL Field_Regrid ." 1318 call esmf_fieldregrid(soil_type_input_grid, &
1320 routehandle=regrid_land, &
1321 zeroregion=esmf_region_select, &
1322 termorderflag=esmf_termorder_srcseq, rc=rc)
1323 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1324 call error_handler(
"IN FieldRegrid", rc)
1327 farrayptr=soil_type_target_ptr, rc=rc)
1328 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1329 call error_handler(
"IN FieldGet", rc)
1331 l = lbound(unmapped_ptr)
1332 u = ubound(unmapped_ptr)
1336 soil_type_target_ptr(i,j) = -9999.9
1342 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1343 call error_handler(
"IN FieldBundleAdd", rc)
1344 call esmf_fieldbundleadd(bundle_nolandice_input, (/veg_greenness_input_grid/), rc=rc)
1345 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1346 call error_handler(
"IN FieldBundleAdd", rc)
1347 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1348 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1349 call error_handler(
"IN FieldBundleGet", rc)
1350 vgfrc_ind = num_fields
1354 call esmf_fieldbundleadd(bundle_nolandice_target, (/
lai_target_grid/), rc=rc)
1355 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1356 call error_handler(
"IN FieldBundleAdd", rc)
1357 call esmf_fieldbundleadd(bundle_nolandice_input, (/lai_input_grid/), rc=rc)
1358 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1359 call error_handler(
"IN FieldBundleAdd", rc)
1360 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1361 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1362 call error_handler(
"IN FieldBundleGet", rc)
1363 lai_ind = num_fields
1368 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1369 call error_handler(
"IN FieldBundleAdd", rc)
1370 call esmf_fieldbundleadd(bundle_nolandice_input, (/max_veg_greenness_input_grid/), rc=rc)
1371 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1372 call error_handler(
"IN FieldBundleAdd", rc)
1375 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1376 call error_handler(
"IN FieldBundleAdd", rc)
1377 call esmf_fieldbundleadd(bundle_nolandice_input, (/min_veg_greenness_input_grid/), rc=rc)
1378 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1379 call error_handler(
"IN FieldBundleAdd", rc)
1381 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1382 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1383 call error_handler(
"IN FieldBundleGet", rc)
1385 mmvg_ind = num_fields-1
1388 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1389 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1390 call error_handler(
"IN FieldBundleGet", rc)
1392 allocate(search_nums(num_fields))
1393 allocate(dozero(num_fields))
1395 search_nums(1:6) = (/85,7,224,85,86,223/)
1396 dozero(1:6) = (/.false.,.false.,.true.,.true.,.false.,.true./)
1399 search_nums(vgfrc_ind) = 224
1400 dozero(vgfrc_ind) = .true.
1404 search_nums(lai_ind) = 229
1405 dozero(lai_ind) = .true.
1409 search_nums(mmvg_ind) = 227
1410 dozero(mmvg_ind) = .true.
1412 search_nums(mmvg_ind+1) = 228
1413 dozero(mmvg_ind+1) = .true.
1416 call regrid_many(bundle_nolandice_input,bundle_nolandice_target,num_fields,regrid_land,dozero, &
1417 unmapped_ptr=unmapped_ptr)
1419 call esmf_fieldbundledestroy(bundle_nolandice_input,rc=rc)
1420 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1421 call error_handler(
"IN FieldBundleDestroy", rc)
1423 if (localpet == 0)
then 1426 allocate (veg_type_target_one_tile(0,0))
1431 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
1433 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1434 call error_handler(
"IN FieldGather", rc)
1436 print*,
"- CALL FieldGather FOR TARGET VEG TYPE TILE: ", tile
1437 call esmf_fieldgather(
veg_type_target_grid, veg_type_target_one_tile, rootpet=0, tile=tile, rc=rc)
1438 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1439 call error_handler(
"IN FieldGather", rc)
1441 if (localpet == 0)
then 1445 print*,
"- CALL FieldGather FOR SOIL TYPE TARGET GRID, TILE: ", tile
1447 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1448 call error_handler(
"IN FieldGather", rc)
1449 if (localpet==0)
then 1450 call search_many(num_fields,bundle_nolandice_target,tile,search_nums,localpet, &
1451 soilt_climo=data_one_tile2, mask=mask_target_one_tile)
1453 call search_many(num_fields,bundle_nolandice_target, tile,search_nums,localpet)
1456 print*,
"- CALL FieldGather FOR TARGET GRID TOTAL SOIL MOISTURE, TILE: ", tile
1458 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1459 call error_handler(
"IN FieldGather", rc)
1461 if (localpet == 0)
then 1463 data_one_tile = data_one_tile_3d(:,:,j)
1465 data_one_tile_3d(:,:,j) = data_one_tile
1469 print*,
"- CALL FieldGather FOR TARGET GRID SOIL TEMPERATURE, TILE: ", tile
1471 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1472 call error_handler(
"IN FieldGather", rc)
1475 print*,
"- CALL FieldScatter FOR TARGET GRID SUBSTRATE TEMPERATURE, TILE: ", tile
1477 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1478 call error_handler(
"IN FieldScatter", rc)
1482 print*,
"- CALL FieldGather FOR SOIL TYPE TARGET GRID LAND, TILE: ",tile
1484 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1485 call error_handler(
"IN FieldGather", rc)
1487 if (localpet == 0)
then 1491 print*,
"- CALL FieldScatter FOR SOIL TYPE TARGET GRID, TILE: ", tile
1493 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1494 call error_handler(
"IN FieldScatter", rc)
1499 deallocate(search_nums)
1500 call esmf_fieldbundledestroy(bundle_nolandice_target,rc=rc)
1501 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1502 call error_handler(
"IN FieldBundleDestroy", rc)
1504 print*,
"- CALL FieldRegridRelease." 1505 call esmf_fieldregridrelease(routehandle=regrid_land, rc=rc)
1506 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1507 call error_handler(
"IN FieldRegridRelease", rc)
1509 deallocate(veg_type_target_one_tile)
1511 deallocate(data_one_tile, data_one_tile2)
1512 deallocate(data_one_tile_3d)
1513 deallocate(mask_target_one_tile)
1537 integer :: clb(3), cub(3), rc
1538 integer :: i, j, n, soil_type
1540 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1543 real(esmf_kind_r8),
pointer :: soilm_liq_ptr(:,:,:)
1544 real(esmf_kind_r8),
pointer :: soilm_tot_ptr(:,:,:)
1545 real(esmf_kind_r8),
pointer :: soil_temp_ptr(:,:,:)
1546 real(esmf_kind_r8),
pointer :: soil_type_ptr(:,:)
1547 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
1549 print*,
"- COMPUTE LIQUID PORTION OF TOTAL SOIL MOISTURE." 1551 print*,
"- CALL FieldGet FOR TOTAL SOIL MOISTURE." 1553 computationallbound=clb, &
1554 computationalubound=cub, &
1555 farrayptr=soilm_tot_ptr, rc=rc)
1556 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1557 call error_handler(
"IN FieldGet", rc)
1559 print*,
"- CALL FieldGet FOR LIQUID SOIL MOISTURE." 1561 farrayptr=soilm_liq_ptr, rc=rc)
1562 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1563 call error_handler(
"IN FieldGet", rc)
1565 print*,
"- CALL FieldGet FOR SOIL TEMPERATURE." 1567 farrayptr=soil_temp_ptr, rc=rc)
1568 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1569 call error_handler(
"IN FieldGet", rc)
1571 print*,
"- CALL FieldGet FOR VEGETATION TYPE." 1573 farrayptr=veg_type_ptr, rc=rc)
1574 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1575 call error_handler(
"IN FieldGet", rc)
1577 print*,
"- CALL FieldGet FOR SOIL TYPE." 1579 farrayptr=soil_type_ptr, rc=rc)
1580 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1581 call error_handler(
"IN FieldGet", rc)
1583 print*,
"- CALL FieldGet FOR LANDMASK." 1585 farrayptr=landmask_ptr, rc=rc)
1586 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1587 call error_handler(
"IN FieldGet", rc)
1589 do j = clb(2), cub(2)
1590 do i = clb(1), cub(1)
1598 soil_type = nint(soil_type_ptr(i,j))
1600 do n = clb(3), cub(3)
1602 if (soil_temp_ptr(i,j,n) < (
frz_h2o-0.0001))
then 1609 ((soil_temp_ptr(i,j,n)-
frz_h2o)/soil_temp_ptr(i,j,n)))** &
1612 if (fk .lt. 0.02) fk = 0.02
1614 soilm_liq_ptr(i,j,n) = min( fk, soilm_tot_ptr(i,j,n) )
1622 soilm_liq_ptr(i,j,n) = frh2o(soil_temp_ptr(i,j,n), &
1623 soilm_tot_ptr(i,j,n), soilm_liq_ptr(i,j,n), &
1629 soilm_liq_ptr(i,j,n) = soilm_tot_ptr(i,j,n)
1666 FUNCTION frh2o (TKELV,SMC,SH2O,SMCMAX,BEXP,PSIS)
1683 REAL(esmf_kind_r8) :: sh2o
1684 REAL(esmf_kind_r8) :: smc
1688 REAL(esmf_kind_r8) :: tkelv
1690 REAL,
PARAMETER :: ck = 8.0
1691 REAL,
PARAMETER :: error = 0.005
1709 IF (ck .NE. 0.0)
THEN 1724 IF (swl .GT. (smc-0.02)) swl = smc-0.02
1725 IF (swl .LT. 0.) swl = 0.
1731 DO WHILE ( (nlog .LT. 10) .AND. (kcount .EQ. 0) )
1734 df = log(( psis*
grav/
hlice ) * ( ( 1.+ck*swl )**2. ) * &
1735 ( smcmax/(smc-swl) )**bx) - log(-(tkelv-
frz_h2o)/tkelv)
1736 denom = 2. * ck / ( 1.+ck*swl ) + bx / ( smc - swl )
1737 swlk = swl - df/denom
1743 IF (swlk .GT. (smc-0.02)) swlk = smc - 0.02
1744 IF (swlk .LT. 0.) swlk = 0.
1750 dswl = abs(swlk-swl)
1758 IF ( dswl .LE. error )
THEN 1784 IF (kcount .EQ. 0)
THEN 1787 ((tkelv-
frz_h2o)/tkelv))**(-1/bx))*smcmax
1789 IF (fk .LT. 0.02) fk = 0.02
1791 frh2o = min(fk, smc)
1821 integer :: clb(3), cub(3), i, j, k, rc
1822 integer :: soilt_input, soilt_target
1823 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1825 real(esmf_kind_r8),
pointer :: soilm_tot_ptr(:,:,:)
1826 real(esmf_kind_r8),
pointer :: soil_type_input_ptr(:,:)
1827 real(esmf_kind_r8),
pointer :: soil_type_target_ptr(:,:)
1828 real(esmf_kind_r8),
pointer :: veg_greenness_ptr(:,:)
1829 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
1830 real :: f1, fn, smcdir, smctra
1832 print*,
"- RESCALE SOIL MOISTURE FOR CHANGES IN SOIL TYPE." 1834 print*,
"- CALL FieldGet FOR TOTAL SOIL MOISTURE." 1836 computationallbound=clb, &
1837 computationalubound=cub, &
1838 farrayptr=soilm_tot_ptr, rc=rc)
1839 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1840 call error_handler(
"IN FieldGet", rc)
1842 print*,
"- CALL FieldGet FOR LAND MASK." 1844 farrayptr=landmask_ptr, rc=rc)
1845 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1846 call error_handler(
"IN FieldGet", rc)
1848 print*,
"- CALL FieldGet FOR VEGETATION TYPE." 1850 farrayptr=veg_type_ptr, rc=rc)
1851 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1852 call error_handler(
"IN FieldGet", rc)
1854 print*,
"- CALL FieldGet FOR VEGETATION GREENNESS." 1856 farrayptr=veg_greenness_ptr, rc=rc)
1857 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1858 call error_handler(
"IN FieldGet", rc)
1860 print*,
"- CALL FieldGet FOR TARGET GRID SOIL TYPE." 1862 farrayptr=soil_type_target_ptr, rc=rc)
1863 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1864 call error_handler(
"IN FieldGet", rc)
1866 print*,
"- CALL FieldGet FOR SOIL TYPE FROM INPUT GRID." 1868 farrayptr=soil_type_input_ptr, rc=rc)
1869 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1870 call error_handler(
"IN FieldGet", rc)
1872 do j = clb(2), cub(2)
1873 do i = clb(1), cub(1)
1881 soilt_target = nint(soil_type_target_ptr(i,j))
1882 soilt_input = nint(soil_type_input_ptr(i,j))
1890 if (soilt_target /= soilt_input)
then 1895 f1=(soilm_tot_ptr(i,j,1)-
drysmc_input(soilt_input)) / &
1905 if (soilm_tot_ptr(i,j,1) <
refsmc_input(soilt_input))
then 1906 f1=(soilm_tot_ptr(i,j,1) -
wltsmc_input(soilt_input)) / &
1911 f1=(soilm_tot_ptr(i,j,1) -
refsmc_input(soilt_input)) / &
1921 soilm_tot_ptr(i,j,1) = ((1.0 - veg_greenness_ptr(i,j)) * smcdir) + &
1922 (veg_greenness_ptr(i,j) * smctra)
1932 if (soilm_tot_ptr(i,j,k) <
refsmc_input(soilt_input))
then 1933 fn = (soilm_tot_ptr(i,j,k) -
wltsmc_input(soilt_input)) / &
1938 fn = (soilm_tot_ptr(i,j,k) -
refsmc_input(soilt_input)) / &
1951 soilm_tot_ptr(i,j,1)=min(soilm_tot_ptr(i,j,1),
maxsmc_target(soilt_target))
1952 soilm_tot_ptr(i,j,1)=max(
drysmc_target(soilt_target),soilm_tot_ptr(i,j,1))
1955 soilm_tot_ptr(i,j,k)=min(soilm_tot_ptr(i,j,k),
maxsmc_target(soilt_target))
1956 soilm_tot_ptr(i,j,k)=max(
wltsmc_target(soilt_target),soilm_tot_ptr(i,j,k))
1981 integer :: clb(3), cub(3), i, j, k, rc
1982 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1984 real,
parameter :: lapse_rate = 6.5e-03
1985 real :: terrain_diff
1986 real(esmf_kind_r8),
pointer :: terrain_input_ptr(:,:)
1987 real(esmf_kind_r8),
pointer :: terrain_target_ptr(:,:)
1988 real(esmf_kind_r8),
pointer :: veg_type_target_ptr(:,:)
1989 real(esmf_kind_r8),
pointer :: soil_temp_target_ptr(:,:,:)
1991 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 1993 farrayptr=landmask_ptr, rc=rc)
1994 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1995 call error_handler(
"IN FieldGet", rc)
1997 print*,
"- CALL FieldGet FOR TARGET GRID VEGETATION TYPE." 1999 farrayptr=veg_type_target_ptr, rc=rc)
2000 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2001 call error_handler(
"IN FieldGet", rc)
2003 print*,
"- CALL FieldGet FOR TARGET GRID TERRAIN." 2005 farrayptr=terrain_target_ptr, rc=rc)
2006 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2007 call error_handler(
"IN FieldGet", rc)
2009 print*,
"- CALL FieldGet FOR TERRAIN INTERP TO TARGET GRID." 2011 farrayptr=terrain_input_ptr, rc=rc)
2012 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2013 call error_handler(
"IN FieldGet", rc)
2015 print*,
"- CALL FieldGet FOR SOIL TEMP TARGET GRID." 2017 computationallbound=clb, &
2018 computationalubound=cub, &
2019 farrayptr=soil_temp_target_ptr, rc=rc)
2020 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2021 call error_handler(
"IN FieldGet", rc)
2023 do j = clb(2), cub(2)
2024 do i = clb(1), cub(1)
2025 if (landmask_ptr(i,j) == 1)
then 2026 terrain_diff = abs(terrain_input_ptr(i,j) - terrain_target_ptr(i,j))
2027 if (terrain_diff > 100.0)
then 2028 do k = clb(3), cub(3)
2029 soil_temp_target_ptr(i,j,k) = soil_temp_target_ptr(i,j,k) + &
2030 ((terrain_input_ptr(i,j) - terrain_target_ptr(i,j)) * lapse_rate)
2032 soil_temp_target_ptr(i,j,k) = min(soil_temp_target_ptr(i,j,k), 273.16)
2050 use sfc_input_data,
only : lsoil_input, soil_temp_input_grid, &
2051 soilm_liq_input_grid, soilm_tot_input_grid
2053 integer,
intent(in) :: localpet
2054 character(len=500) :: msg
2055 character(len=2) :: lsoil_input_ch, lsoil_target_ch
2057 real(esmf_kind_r8) :: tmp(i_input,j_input), &
2058 data_one_tile(i_input,j_input,lsoil_input), &
2059 tmp3d(i_input,j_input,lsoil_target)
2060 if (lsoil_input == 9 .and. lsoil_target == 4)
then 2061 print*,
"CONVERTING FROM 9 INPUT SOIL LEVELS TO 4 TARGET SOIL LEVELS" 2062 call esmf_fieldgather(soil_temp_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2063 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2064 call error_handler(
"IN FieldGather", rc)
2066 call esmf_fielddestroy(soil_temp_input_grid,rc=rc)
2067 soil_temp_input_grid = esmf_fieldcreate(
input_grid, &
2068 typekind=esmf_typekind_r8, &
2069 staggerloc=esmf_staggerloc_center, &
2070 ungriddedlbound=(/1/), &
2071 ungriddedubound=(/lsoil_target/), rc=rc)
2074 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2075 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2076 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2077 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2078 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2079 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2080 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2081 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2082 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2083 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2084 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2087 call esmf_fieldscatter(soil_temp_input_grid, tmp3d, rootpet=0, rc=rc)
2088 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2089 call error_handler(
"IN FieldScatter", rc)
2091 call esmf_fieldgather(soilm_tot_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2092 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2093 call error_handler(
"IN FieldGather", rc)
2095 call esmf_fielddestroy(soilm_tot_input_grid,rc=rc)
2096 soilm_tot_input_grid = esmf_fieldcreate(
input_grid, &
2097 typekind=esmf_typekind_r8, &
2098 staggerloc=esmf_staggerloc_center, &
2099 ungriddedlbound=(/1/), &
2100 ungriddedubound=(/lsoil_target/), rc=rc)
2102 if(localpet==0)
then 2103 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2104 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2105 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2106 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2107 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2108 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2109 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2110 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2111 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2112 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2113 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2116 call esmf_fieldscatter(soilm_tot_input_grid, tmp3d, rootpet=0, rc=rc)
2117 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2118 call error_handler(
"IN FieldScatter", rc)
2120 call esmf_fieldgather(soilm_liq_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2121 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2122 call error_handler(
"IN FieldGather", rc)
2124 call esmf_fielddestroy(soilm_liq_input_grid,rc=rc)
2125 soilm_liq_input_grid = esmf_fieldcreate(
input_grid, &
2126 typekind=esmf_typekind_r8, &
2127 staggerloc=esmf_staggerloc_center, &
2128 ungriddedlbound=(/1/), &
2129 ungriddedubound=(/lsoil_target/), rc=rc)
2130 if(localpet==0)
then 2131 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2132 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2133 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2134 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2135 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2136 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2137 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2138 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2139 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2140 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2141 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2144 call esmf_fieldscatter(soilm_liq_input_grid, tmp3d, rootpet=0, rc=rc)
2145 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2146 call error_handler(
"IN FieldScatter", rc)
2148 elseif (lsoil_input /= lsoil_target)
then 2150 write(lsoil_input_ch,
'(i2)') lsoil_input
2151 write(lsoil_target_ch,
'(i2)') lsoil_target
2152 msg=
"NUMBER OF SOIL LEVELS IN INPUT " // lsoil_input_ch //
" AND OUTPUT " &
2153 // lsoil_target_ch //
" MUST EITHER BE EQUAL OR 9 AND 4 RESPECTIVELY." 2154 call error_handler(msg, rc)
2170 integer :: clb(2), cub(2), i, j, rc
2171 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
2172 integer(esmf_kind_i8),
pointer :: seamask_ptr(:,:)
2174 real(esmf_kind_r8),
pointer :: data_ptr2(:,:)
2175 real(esmf_kind_r8),
pointer :: data_ptr3(:,:)
2176 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2178 print*,
"- SET ROUGHNESS." 2180 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 2182 computationallbound=clb, &
2183 computationalubound=cub, &
2184 farrayptr=landmask_ptr, rc=rc)
2185 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2186 call error_handler(
"IN FieldGet", rc)
2188 print*,
"- CALL FieldGet FOR TARGET GRID SEA ICE." 2190 farrayptr=fice_ptr, rc=rc)
2191 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2192 call error_handler(
"IN FieldGet", rc)
2194 print*,
"- CALL FieldGet FOR TARGET GRID Z0 WATER." 2196 farrayptr=data_ptr3, rc=rc)
2197 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2198 call error_handler(
"IN FieldGet", rc)
2200 print*,
"- CALL FieldGet FOR TARGET SEA MASK." 2202 farrayptr=seamask_ptr, rc=rc)
2203 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2204 call error_handler(
"IN FieldGet", rc)
2206 print*,
"- CALL FieldGet FOR TARGET GRID Z0 ICE." 2208 farrayptr=data_ptr2, rc=rc)
2209 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2210 call error_handler(
"IN FieldGet", rc)
2214 do j = clb(2), cub(2)
2215 do i = clb(1), cub(1)
2216 if (fice_ptr(i,j) > 0.0)
then 2217 data_ptr2(i,j) = 1.0
2227 do j = clb(2), cub(2)
2228 do i = clb(1), cub(1)
2229 if (fice_ptr(i,j) == 1.0_esmf_kind_r8 .or. seamask_ptr(i,j) == 0)
then 2263 integer :: clb(2), cub(2), i, j, rc
2264 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
2265 integer(esmf_kind_i8),
pointer :: seamask_ptr(:,:)
2267 real(esmf_kind_r8),
pointer :: data_ptr(:,:)
2268 real(esmf_kind_r8),
pointer :: data3d_ptr(:,:,:)
2269 real(esmf_kind_r8),
pointer :: ice_ptr(:,:,:)
2270 real(esmf_kind_r8),
pointer :: soilmt_ptr(:,:,:)
2271 real(esmf_kind_r8),
pointer :: soilml_ptr(:,:,:)
2272 real(esmf_kind_r8),
pointer :: veg_greenness_ptr(:,:)
2273 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
2274 real(esmf_kind_r8),
pointer :: seaice_skint_ptr(:,:)
2275 real(esmf_kind_r8),
pointer :: skint_ptr(:,:)
2276 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2277 real(esmf_kind_r8),
pointer :: hice_ptr(:,:)
2278 real(esmf_kind_r8),
pointer :: tg3_ptr(:,:)
2279 real(esmf_kind_r8),
pointer :: snod_ptr(:,:)
2280 real(esmf_kind_r8),
pointer :: snol_ptr(:,:)
2282 print*,
'- PERFORM QC CHECK' 2284 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 2286 computationallbound=clb, &
2287 computationalubound=cub, &
2288 farrayptr=landmask_ptr, rc=rc)
2289 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2290 call error_handler(
"IN FieldGet", rc)
2292 print*,
"- CALL FieldGet FOR TARGET GRID SEA MASK." 2294 farrayptr=seamask_ptr, rc=rc)
2295 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2296 call error_handler(
"IN FieldGet", rc)
2298 print*,
"- CALL FieldGet FOR TARGET GRID SEA ICE FRACTION." 2300 farrayptr=fice_ptr, rc=rc)
2301 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2302 call error_handler(
"IN FieldGet", rc)
2304 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SLOPE TYPE." 2306 farrayptr=data_ptr, rc=rc)
2307 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2308 call error_handler(
"IN FieldGet", rc)
2310 do j = clb(2), cub(2)
2311 do i = clb(1), cub(1)
2312 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2316 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SOIL TYPE." 2318 farrayptr=data_ptr, rc=rc)
2319 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2320 call error_handler(
"IN FieldGet", rc)
2322 do j = clb(2), cub(2)
2323 do i = clb(1), cub(1)
2324 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2328 print*,
"- SET NON-LAND FLAG FOR TARGET GRID VEGETATION TYPE." 2330 farrayptr=veg_type_ptr, rc=rc)
2331 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2332 call error_handler(
"IN FieldGet", rc)
2334 do j = clb(2), cub(2)
2335 do i = clb(1), cub(1)
2336 if (landmask_ptr(i,j) == 0) veg_type_ptr(i,j) = 0.0
2340 print*,
"- SET TARGET GRID ALVSF FLAG AT NON-LAND." 2342 farrayptr=data_ptr, rc=rc)
2343 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2344 call error_handler(
"IN FieldGet", rc)
2346 do j = clb(2), cub(2)
2347 do i = clb(1), cub(1)
2348 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2352 print*,
"- SET TARGET GRID ALVWF FLAG AT NON-LAND." 2354 farrayptr=data_ptr, rc=rc)
2355 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2356 call error_handler(
"IN FieldGet", rc)
2358 do j = clb(2), cub(2)
2359 do i = clb(1), cub(1)
2360 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2364 print*,
"- SET TARGET GRID ALNSF FLAG AT NON-LAND." 2366 farrayptr=data_ptr, rc=rc)
2367 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2368 call error_handler(
"IN FieldGet", rc)
2370 do j = clb(2), cub(2)
2371 do i = clb(1), cub(1)
2372 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2376 print*,
"- SET TARGET GRID ALNWF FLAG AT NON-LAND." 2378 farrayptr=data_ptr, rc=rc)
2379 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2380 call error_handler(
"IN FieldGet", rc)
2382 do j = clb(2), cub(2)
2383 do i = clb(1), cub(1)
2384 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2388 print*,
"- SET NON-LAND FLAG FOR TARGET GRID FACSF." 2390 farrayptr=data_ptr, rc=rc)
2391 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2392 call error_handler(
"IN FieldGet", rc)
2394 do j = clb(2), cub(2)
2395 do i = clb(1), cub(1)
2396 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2400 print*,
"- SET NON-LAND FLAG FOR TARGET GRID FACWF." 2402 farrayptr=data_ptr, rc=rc)
2403 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2404 call error_handler(
"IN FieldGet", rc)
2406 do j = clb(2), cub(2)
2407 do i = clb(1), cub(1)
2408 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2412 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MAXIMUM GREENNESS." 2414 farrayptr=data_ptr, rc=rc)
2415 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2416 call error_handler(
"IN FieldGet", rc)
2418 do j = clb(2), cub(2)
2419 do i = clb(1), cub(1)
2420 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2424 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MINIMUM GREENNESS." 2426 farrayptr=data_ptr, rc=rc)
2427 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2428 call error_handler(
"IN FieldGet", rc)
2430 do j = clb(2), cub(2)
2431 do i = clb(1), cub(1)
2432 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2436 print*,
"- SET NON-LAND FLAG FOR TARGET GRID VEGETATION GREENNESS." 2438 farrayptr=veg_greenness_ptr, rc=rc)
2439 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2440 call error_handler(
"IN FieldGet", rc)
2442 do j = clb(2), cub(2)
2443 do i = clb(1), cub(1)
2444 if (landmask_ptr(i,j) == 0) veg_greenness_ptr(i,j) = 0.0
2448 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MAX SNOW ALBEDO." 2450 farrayptr=data_ptr, rc=rc)
2451 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2452 call error_handler(
"IN FieldGet", rc)
2454 do j = clb(2), cub(2)
2455 do i = clb(1), cub(1)
2456 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2460 print*,
"- QC TARGET GRID CANOPY MOISTURE CONTENT." 2462 farrayptr=data_ptr, rc=rc)
2463 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2464 call error_handler(
"IN FieldGet", rc)
2468 do j = clb(2), cub(2)
2469 do i = clb(1), cub(1)
2470 if (veg_greenness_ptr(i,j) <= 0.01) data_ptr(i,j) = 0.0
2471 if (data_ptr(i,j) > 2.0) data_ptr(i,j) = 2.0
2479 print*,
"- CALL FieldGet FOR TARGET GRID ICE SKIN TEMP." 2481 farrayptr=seaice_skint_ptr, rc=rc)
2482 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2483 call error_handler(
"IN FieldGet", rc)
2485 print*,
"- CALL FieldGet FOR TARGET GRID SKIN TEMP." 2487 farrayptr=skint_ptr, rc=rc)
2488 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2489 call error_handler(
"IN FieldGet", rc)
2491 print*,
"- CALL FieldGet FOR TARGET GRID ICE DEPTH." 2493 farrayptr=hice_ptr, rc=rc)
2494 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2495 call error_handler(
"IN FieldGet", rc)
2501 print*,
"- SET TARGET GRID SEA ICE DEPTH TO ZERO AT NON-ICE POINTS." 2503 do j = clb(2), cub(2)
2504 do i = clb(1), cub(1)
2505 if (fice_ptr(i,j) == 0.0)
then 2506 if (seamask_ptr(i,j) == 0)
then 2507 seaice_skint_ptr(i,j) =
missing 2509 seaice_skint_ptr(i,j) =
frz_ice 2516 print*,
"- SET TARGET GRID SST FLAG VALUE." 2518 farrayptr=data_ptr, rc=rc)
2519 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2520 call error_handler(
"IN FieldGet", rc)
2524 do j = clb(2), cub(2)
2525 do i = clb(1), cub(1)
2526 if (fice_ptr(i,j) == 1.0_esmf_kind_r8 .or. seamask_ptr(i,j) == 0.0)
then 2532 print*,
"- SET MISSING FLAG AT TARGET GRID SUBSTRATE TEMP." 2534 farrayptr=tg3_ptr, rc=rc)
2535 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2536 call error_handler(
"IN FieldGet", rc)
2538 do j = clb(2), cub(2)
2539 do i = clb(1), cub(1)
2540 if (landmask_ptr(i,j) == 0.0)
then 2546 print*,
"- SET MISSING FLAG AT TARGET GRID SNOW FIELDS AT ICE." 2548 print*,
"- CALL FieldGet FOR TARGET GRID SNOW DEPTH AT ICE." 2550 farrayptr=snod_ptr, rc=rc)
2551 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2552 call error_handler(
"IN FieldGet", rc)
2554 print*,
"- CALL FieldGet FOR TARGET GRID SNOW LIQ EQUIV AT ICE." 2556 farrayptr=snol_ptr, rc=rc)
2557 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2558 call error_handler(
"IN FieldGet", rc)
2560 do j = clb(2), cub(2)
2561 do i = clb(1), cub(1)
2562 if (fice_ptr(i,j) == 0.0)
then 2569 print*,
"- SET NON-LAND FLAG AT TARGET GRID SNOW DEPTH." 2571 farrayptr=data_ptr, rc=rc)
2572 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2573 call error_handler(
"IN FieldGet", rc)
2575 do j = clb(2), cub(2)
2576 do i = clb(1), cub(1)
2577 if (landmask_ptr(i,j) == 0)
then 2583 print*,
"- SET NON-LAND FLAG AT TARGET GRID SNOW LIQ." 2585 farrayptr=data_ptr, rc=rc)
2586 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2587 call error_handler(
"IN FieldGet", rc)
2589 do j = clb(2), cub(2)
2590 do i = clb(1), cub(1)
2591 if (landmask_ptr(i,j) == 0)
then 2597 print*,
"- SET NON-LAND FLAG VALUE FOR TARGET GRID TOTAL SOIL MOISTURE." 2599 farrayptr=soilmt_ptr, rc=rc)
2600 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2601 call error_handler(
"IN FieldGet", rc)
2603 print*,
"- SET NON-LAND FLAG VALUE FOR TARGET GRID LIQUID SOIL MOISTURE." 2605 farrayptr=soilml_ptr, rc=rc)
2606 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2607 call error_handler(
"IN FieldGet", rc)
2609 do j = clb(2), cub(2)
2610 do i = clb(1), cub(1)
2611 if (landmask_ptr(i,j) == 0 .or. &
2613 soilmt_ptr(i,j,:) = 1.0
2614 soilml_ptr(i,j,:) = 1.0
2619 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SOIL TEMPERATURE." 2621 farrayptr=data3d_ptr, rc=rc)
2622 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2623 call error_handler(
"IN FieldGet", rc)
2625 do j = clb(2), cub(2)
2626 do i = clb(1), cub(1)
2627 if (landmask_ptr(i,j) == 0)
then 2633 print*,
"- SET NON-ICE FLAG FOR TARGET GRID ICE COLUMN TEMPERATURE." 2635 farrayptr=ice_ptr, rc=rc)
2636 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2637 call error_handler(
"IN FieldGet", rc)
2643 do j = clb(2), cub(2)
2644 do i = clb(1), cub(1)
2645 if (fice_ptr(i,j) == 0.0)
then 2646 if (seamask_ptr(i,j) == 0)
then 2655 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SKIN TEMPERATURE." 2657 do j = clb(2), cub(2)
2658 do i = clb(1), cub(1)
2659 if (landmask_ptr(i,j) == 0)
then 2679 integer(esmf_kind_i8),
pointer :: mask_ptr(:,:)
2681 integer,
PARAMETER :: num_nst_fields_minus2 = 16
2682 integer,
PARAMETER :: xz_fill = 30.0
2683 integer,
PARAMETER :: nst_fill = 0.0
2685 real(esmf_kind_r8),
pointer :: data_ptr(:,:)
2686 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2687 real(esmf_kind_r8),
pointer :: skint_ptr(:,:)
2689 type(esmf_field) :: temp_field
2690 type(esmf_fieldbundle) :: nst_bundle
2692 print*,
"- CALL FieldGet FOR TARGET GRID SEAMASK." 2694 farrayptr=mask_ptr, rc=rc)
2695 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2696 call error_handler(
"IN FieldGet", rc)
2698 print*,
"- CALL FieldGet FOR TARGET GRID SEAICE FRACT." 2700 farrayptr=fice_ptr, rc=rc)
2701 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2702 call error_handler(
"IN FieldGet", rc)
2704 nst_bundle = esmf_fieldbundlecreate(name=
"nst_bundle", rc=rc)
2705 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2706 call error_handler(
"IN FieldBundleCreate", rc)
2713 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2714 call error_handler(
"IN FieldBundleAdd", rc)
2716 print*,
"- CALL FieldGet FOR TREF." 2718 farrayptr=data_ptr, rc=rc)
2719 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2720 call error_handler(
"IN FieldGet", rc)
2722 print*,
"- CALL FieldGet FOR SKIN T." 2724 farrayptr=skint_ptr, rc=rc)
2725 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2726 call error_handler(
"IN FieldGet", rc)
2728 where(mask_ptr == 0) data_ptr = skint_ptr
2729 where(fice_ptr > 0.0) data_ptr =
frz_ice 2733 print*,
"- CALL FieldGet FOR XZ." 2735 farrayptr=data_ptr, rc=rc)
2736 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2737 call error_handler(
"IN FieldGet", rc)
2739 where(mask_ptr == 0) data_ptr = xz_fill
2740 where(fice_ptr > 0.0) data_ptr = xz_fill
2742 do i = 1,num_nst_fields_minus2
2744 call esmf_fieldbundleget(nst_bundle,i,temp_field,rc=rc)
2745 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2746 call error_handler(
"IN FieldBundleGet", rc)
2748 call esmf_fieldget(temp_field,farrayptr=data_ptr,rc=rc)
2749 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2750 call error_handler(
"IN FieldGet", rc)
2752 where(mask_ptr == 0) data_ptr = nst_fill
2753 where(fice_ptr > 0.0) data_ptr = nst_fill
2757 call esmf_fieldbundledestroy(nst_bundle,rc=rc)
2758 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2759 call error_handler(
"IN FieldBundleDestroy", rc)
2774 real(esmf_kind_r8),
pointer :: target_ptr(:,:), target_ptr_3d(:,:,:)
2775 real :: init_val = -999.9
2777 print*,
"- CALL FieldCreate FOR TARGET GRID T2M." 2779 typekind=esmf_typekind_r8, &
2780 name=
"t2m_target_grid", &
2781 staggerloc=esmf_staggerloc_center, rc=rc)
2782 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2783 call error_handler(
"IN FieldCreate", rc)
2785 print*,
"- INITIALIZE TARGET grid t2m." 2787 farrayptr=target_ptr, rc=rc)
2788 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2789 call error_handler(
"IN FieldGet", rc)
2791 target_ptr = init_val
2793 print*,
"- CALL FieldCreate FOR TARGET GRID Q2M." 2795 typekind=esmf_typekind_r8, &
2796 name=
"q2m_target_grid", &
2797 staggerloc=esmf_staggerloc_center, rc=rc)
2798 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2799 call error_handler(
"IN FieldCreate", rc)
2801 print*,
"- INITIALIZE TARGET grid q2m." 2803 farrayptr=target_ptr, rc=rc)
2804 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2805 call error_handler(
"IN FieldGet", rc)
2807 target_ptr = init_val
2809 print*,
"- CALL FieldCreate FOR TARGET GRID TPRCP." 2811 typekind=esmf_typekind_r8, &
2812 name=
"tprcp_target_grid", &
2813 staggerloc=esmf_staggerloc_center, rc=rc)
2814 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2815 call error_handler(
"IN FieldCreate", rc)
2817 print*,
"- INITIALIZE TARGET grid tprcp." 2819 farrayptr=target_ptr, rc=rc)
2820 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2821 call error_handler(
"IN FieldGet", rc)
2823 target_ptr = init_val
2825 print*,
"- CALL FieldCreate FOR TARGET GRID F10M." 2827 typekind=esmf_typekind_r8, &
2828 name=
"f10m_target_grid", &
2829 staggerloc=esmf_staggerloc_center, rc=rc)
2830 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2831 call error_handler(
"IN FieldCreate", rc)
2833 print*,
"- INITIALIZE TARGET grid f10m." 2835 farrayptr=target_ptr, rc=rc)
2836 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2837 call error_handler(
"IN FieldGet", rc)
2839 target_ptr = init_val
2841 print*,
"- CALL FieldCreate FOR TARGET GRID FFMM." 2843 typekind=esmf_typekind_r8, &
2844 name=
"ffmm_target_grid", &
2845 staggerloc=esmf_staggerloc_center, rc=rc)
2846 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2847 call error_handler(
"IN FieldCreate", rc)
2849 print*,
"- INITIALIZE TARGET grid ffmm." 2851 farrayptr=target_ptr, rc=rc)
2852 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2853 call error_handler(
"IN FieldGet", rc)
2855 target_ptr = init_val
2857 print*,
"- CALL FieldCreate FOR TARGET GRID USTAR." 2859 typekind=esmf_typekind_r8, &
2860 name=
"ustar_target_grid", &
2861 staggerloc=esmf_staggerloc_center, rc=rc)
2862 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2863 call error_handler(
"IN FieldCreate", rc)
2865 print*,
"- INITIALIZE TARGET grid ustar." 2867 farrayptr=target_ptr, rc=rc)
2868 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2869 call error_handler(
"IN FieldGet", rc)
2871 target_ptr = init_val
2873 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW LIQ EQUIV." 2875 typekind=esmf_typekind_r8, &
2876 name=
"snow_liq_equiv_target_grid", &
2877 staggerloc=esmf_staggerloc_center, rc=rc)
2878 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2879 call error_handler(
"IN FieldCreate", rc)
2881 print*,
"- INITIALIZE TARGET grid snow liq equiv." 2883 farrayptr=target_ptr, rc=rc)
2884 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2885 call error_handler(
"IN FieldGet", rc)
2887 target_ptr = init_val
2889 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW LIQ EQUIV AT SEA ICE." 2891 typekind=esmf_typekind_r8, &
2892 name=
"snow_liq_equiv_at_ice_target_grid", &
2893 staggerloc=esmf_staggerloc_center, rc=rc)
2894 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2895 call error_handler(
"IN FieldCreate", rc)
2897 print*,
"- INITIALIZE TARGET grid snow liq equiv at sea ice." 2899 farrayptr=target_ptr, rc=rc)
2900 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2901 call error_handler(
"IN FieldGet", rc)
2903 target_ptr = init_val
2905 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW DEPTH." 2907 typekind=esmf_typekind_r8, &
2908 name=
"snow_depth_target_grid", &
2909 staggerloc=esmf_staggerloc_center, rc=rc)
2910 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2911 call error_handler(
"IN FieldCreate", rc)
2913 print*,
"- INITIALIZE TARGET grid snow depth." 2915 farrayptr=target_ptr, rc=rc)
2916 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2917 call error_handler(
"IN FieldGet", rc)
2919 target_ptr = init_val
2921 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW DEPTH AT SEA ICE." 2923 typekind=esmf_typekind_r8, &
2924 name=
"snow_depth_at_ice_target_grid", &
2925 staggerloc=esmf_staggerloc_center, rc=rc)
2926 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2927 call error_handler(
"IN FieldCreate", rc)
2929 print*,
"- INITIALIZE TARGET grid snow depth at sea ice." 2931 farrayptr=target_ptr, rc=rc)
2932 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2933 call error_handler(
"IN FieldGet", rc)
2935 target_ptr = init_val
2937 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE FRACTION." 2939 typekind=esmf_typekind_r8, &
2940 name=
"seaice_fract_target_grid", &
2941 staggerloc=esmf_staggerloc_center, rc=rc)
2942 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2943 call error_handler(
"IN FieldCreate", rc)
2945 print*,
"- INITIALIZE TARGET grid sea ice fraction." 2947 farrayptr=target_ptr, rc=rc)
2948 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2949 call error_handler(
"IN FieldGet", rc)
2951 target_ptr = init_val
2953 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE DEPTH." 2955 typekind=esmf_typekind_r8, &
2956 name=
"seaice_depth_target_grid", &
2957 staggerloc=esmf_staggerloc_center, rc=rc)
2958 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2959 call error_handler(
"IN FieldCreate", rc)
2961 print*,
"- INITIALIZE TARGET sea ice depth." 2963 farrayptr=target_ptr, rc=rc)
2964 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2965 call error_handler(
"IN FieldGet", rc)
2967 target_ptr = init_val
2969 print*,
"- CALL FieldCreate FOR TARGET GRID sst." 2971 typekind=esmf_typekind_r8, &
2972 name=
"sst_target_grid", &
2973 staggerloc=esmf_staggerloc_center, rc=rc)
2974 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2975 call error_handler(
"IN FieldCreate", rc)
2977 print*,
"- INITIALIZE TARGET sst." 2979 farrayptr=target_ptr, rc=rc)
2980 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2981 call error_handler(
"IN FieldGet", rc)
2983 target_ptr = init_val
2985 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE SKIN TEMP." 2987 typekind=esmf_typekind_r8, &
2988 name=
"seaice_skin_temp_target_grid", &
2989 staggerloc=esmf_staggerloc_center, rc=rc)
2990 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2991 call error_handler(
"IN FieldCreate", rc)
2993 print*,
"- INITIALIZE TARGET sea ice skin temp." 2995 farrayptr=target_ptr, rc=rc)
2996 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2997 call error_handler(
"IN FieldGet", rc)
2999 target_ptr = init_val
3001 print*,
"- CALL FieldCreate FOR TARGET GRID SRFLAG." 3003 typekind=esmf_typekind_r8, &
3004 name=
"srflag_target_grid", &
3005 staggerloc=esmf_staggerloc_center, rc=rc)
3006 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3007 call error_handler(
"IN FieldCreate", rc)
3009 print*,
"- INITIALIZE TARGET srflag." 3011 farrayptr=target_ptr, rc=rc)
3012 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3013 call error_handler(
"IN FieldGet", rc)
3015 target_ptr = init_val
3017 print*,
"- CALL FieldCreate FOR TARGET GRID SKIN TEMPERATURE." 3019 typekind=esmf_typekind_r8, &
3020 name=
"skin_temp_target_grid", &
3021 staggerloc=esmf_staggerloc_center, rc=rc)
3022 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3023 call error_handler(
"IN FieldCreate", rc)
3025 print*,
"- INITIALIZE TARGET grid skin temp." 3027 farrayptr=target_ptr, rc=rc)
3028 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3029 call error_handler(
"IN FieldGet", rc)
3031 target_ptr = init_val
3033 print*,
"- CALL FieldCreate FOR TARGET GRID CANOPY MOISTURE CONTENT." 3035 typekind=esmf_typekind_r8, &
3036 name=
"canopy_mc_target_grid", &
3037 staggerloc=esmf_staggerloc_center, rc=rc)
3038 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3039 call error_handler(
"IN FieldCreate", rc)
3041 print*,
"- INITIALIZE TARGET grid canopy moisture." 3043 farrayptr=target_ptr, rc=rc)
3044 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3045 call error_handler(
"IN FieldGet", rc)
3047 target_ptr = init_val
3049 print*,
"- CALL FieldCreate FOR TARGET GRID LEAF AREA INDEX." 3051 typekind=esmf_typekind_r8, &
3052 name=
"lai_target_grid",&
3053 staggerloc=esmf_staggerloc_center, rc=rc)
3054 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3055 call error_handler(
"IN FieldCreate", rc)
3057 print*,
"- INITIALIZE TARGET leaf area index." 3059 farrayptr=target_ptr, rc=rc)
3060 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3061 call error_handler(
"IN FieldGet", rc)
3063 target_ptr = init_val
3065 print*,
"- CALL FieldCreate FOR TARGET GRID Z0_ICE." 3067 typekind=esmf_typekind_r8, &
3068 name=
"z0_ice_target_grid", &
3069 staggerloc=esmf_staggerloc_center, rc=rc)
3070 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3071 call error_handler(
"IN FieldCreate", rc)
3073 print*,
"- INITIALIZE TARGET grid z0_ice." 3075 farrayptr=target_ptr, rc=rc)
3076 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3077 call error_handler(
"IN FieldGet", rc)
3079 target_ptr = init_val
3081 print*,
"- CALL FieldCreate FOR TARGET GRID Z0_WATER." 3083 typekind=esmf_typekind_r8, &
3084 name=
"z0_water_target_grid", &
3085 staggerloc=esmf_staggerloc_center, rc=rc)
3086 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3087 call error_handler(
"IN FieldCreate", rc)
3089 print*,
"- INITIALIZE TARGET grid z0_water." 3091 farrayptr=target_ptr, rc=rc)
3092 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3093 call error_handler(
"IN FieldGet", rc)
3095 target_ptr = init_val
3097 print*,
"- CALL FieldCreate FOR INTERPOLATED TARGET GRID TERRAIN." 3099 typekind=esmf_typekind_r8, &
3100 name=
"terrain_from_input_grid", &
3101 staggerloc=esmf_staggerloc_center, rc=rc)
3102 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3103 call error_handler(
"IN FieldCreate", rc)
3105 print*,
"- INITIALIZE TARGET grid interpolated terrain." 3107 farrayptr=target_ptr, rc=rc)
3108 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3109 call error_handler(
"IN FieldGet", rc)
3111 target_ptr = init_val
3113 print*,
"- CALL FieldCreate FOR INTERPOLATED TARGET GRID SOIL TYPE." 3115 typekind=esmf_typekind_r8, &
3116 staggerloc=esmf_staggerloc_center, &
3117 name=
"soil_type_from_input_grid", rc=rc)
3118 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3119 call error_handler(
"IN FieldCreate", rc)
3121 print*,
"- INITIALIZE TARGET grid soil type" 3123 farrayptr=target_ptr, rc=rc)
3124 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3125 call error_handler(
"IN FieldGet", rc)
3127 target_ptr = init_val
3129 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE COLUMN TEMPERATURE." 3131 typekind=esmf_typekind_r8, &
3132 staggerloc=esmf_staggerloc_center, &
3133 name=
"ice_temp_target_grid", &
3134 ungriddedlbound=(/1/), &
3136 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3137 call error_handler(
"IN FieldCreate", rc)
3139 print*,
"- INITIALIZE TARGET grid ice temp" 3141 farrayptr=target_ptr_3d, rc=rc)
3142 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3143 call error_handler(
"IN FieldGet", rc)
3145 target_ptr_3d = init_val
3147 print*,
"- CALL FieldCreate FOR TARGET GRID SOIL TEMPERATURE." 3149 typekind=esmf_typekind_r8, &
3150 staggerloc=esmf_staggerloc_center, &
3151 name=
"soil_temp_target_grid", &
3152 ungriddedlbound=(/1/), &
3154 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3155 call error_handler(
"IN FieldCreate", rc)
3157 print*,
"- INITIALIZE TARGET grid soil temp" 3159 farrayptr=target_ptr_3d, rc=rc)
3160 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3161 call error_handler(
"IN FieldGet", rc)
3163 target_ptr_3d = init_val
3165 print*,
"- CALL FieldCreate FOR TARGET GRID TOTAL SOIL MOISTURE." 3167 typekind=esmf_typekind_r8, &
3168 staggerloc=esmf_staggerloc_center, &
3169 name=
"soilm_tot_target_grid", &
3170 ungriddedlbound=(/1/), &
3172 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3173 call error_handler(
"IN FieldCreate", rc)
3175 print*,
"- INITIALIZE TARGET grid soil moist" 3177 farrayptr=target_ptr_3d, rc=rc)
3178 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3179 call error_handler(
"IN FieldGet", rc)
3181 target_ptr_3d = init_val
3183 print*,
"- CALL FieldCreate FOR TARGET GRID LIQUID SOIL MOISTURE." 3185 typekind=esmf_typekind_r8, &
3186 staggerloc=esmf_staggerloc_center, &
3187 name=
"soilm_liq_target_grid", &
3188 ungriddedlbound=(/1/), &
3190 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3191 call error_handler(
"IN FieldCreate", rc)
3193 print*,
"- INITIALIZE TARGET grid soil liq" 3195 farrayptr=target_ptr_3d, rc=rc)
3196 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3197 call error_handler(
"IN FieldGet", rc)
3199 target_ptr_3d = init_val
3214 print*,
"- CALL FieldCreate FOR TARGET GRID C_D." 3216 typekind=esmf_typekind_r8, &
3218 staggerloc=esmf_staggerloc_center, rc=rc)
3219 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3220 call error_handler(
"IN FieldCreate", rc)
3222 print*,
"- CALL FieldCreate FOR TARGET GRID C_0." 3224 typekind=esmf_typekind_r8, &
3226 staggerloc=esmf_staggerloc_center, rc=rc)
3227 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3228 call error_handler(
"IN FieldCreate", rc)
3230 print*,
"- CALL FieldCreate FOR TARGET GRID D_CONV." 3232 typekind=esmf_typekind_r8, &
3234 staggerloc=esmf_staggerloc_center, rc=rc)
3235 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3236 call error_handler(
"IN FieldCreate", rc)
3238 print*,
"- CALL FieldCreate FOR TARGET GRID DT_COOL." 3240 typekind=esmf_typekind_r8, &
3242 staggerloc=esmf_staggerloc_center, rc=rc)
3243 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3244 call error_handler(
"IN FieldCreate", rc)
3246 print*,
"- CALL FieldCreate FOR TARGET GRID IFD." 3248 typekind=esmf_typekind_r8, &
3250 staggerloc=esmf_staggerloc_center, rc=rc)
3251 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3252 call error_handler(
"IN FieldCreate", rc)
3254 print*,
"- CALL FieldCreate FOR TARGET GRID QRAIN." 3256 typekind=esmf_typekind_r8, &
3258 staggerloc=esmf_staggerloc_center, rc=rc)
3259 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3260 call error_handler(
"IN FieldCreate", rc)
3262 print*,
"- CALL FieldCreate FOR TARGET GRID TREF." 3264 typekind=esmf_typekind_r8, &
3266 staggerloc=esmf_staggerloc_center, rc=rc)
3267 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3268 call error_handler(
"IN FieldCreate", rc)
3270 print*,
"- CALL FieldCreate FOR TARGET GRID W_D." 3272 typekind=esmf_typekind_r8, &
3274 staggerloc=esmf_staggerloc_center, rc=rc)
3275 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3276 call error_handler(
"IN FieldCreate", rc)
3278 print*,
"- CALL FieldCreate FOR TARGET GRID W_0." 3280 typekind=esmf_typekind_r8, &
3282 staggerloc=esmf_staggerloc_center, rc=rc)
3283 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3284 call error_handler(
"IN FieldCreate", rc)
3286 print*,
"- CALL FieldCreate FOR TARGET GRID XS." 3288 typekind=esmf_typekind_r8, &
3290 staggerloc=esmf_staggerloc_center, rc=rc)
3291 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3292 call error_handler(
"IN FieldCreate", rc)
3294 print*,
"- CALL FieldCreate FOR TARGET GRID XT." 3296 typekind=esmf_typekind_r8, &
3298 staggerloc=esmf_staggerloc_center, rc=rc)
3299 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3300 call error_handler(
"IN FieldCreate", rc)
3302 print*,
"- CALL FieldCreate FOR TARGET GRID XU." 3304 typekind=esmf_typekind_r8, &
3306 staggerloc=esmf_staggerloc_center, rc=rc)
3307 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3308 call error_handler(
"IN FieldCreate", rc)
3310 print*,
"- CALL FieldCreate FOR TARGET GRID XV." 3312 typekind=esmf_typekind_r8, &
3314 staggerloc=esmf_staggerloc_center, rc=rc)
3315 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3316 call error_handler(
"IN FieldCreate", rc)
3318 print*,
"- CALL FieldCreate FOR TARGET GRID XZ." 3320 typekind=esmf_typekind_r8, &
3322 staggerloc=esmf_staggerloc_center, rc=rc)
3323 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3324 call error_handler(
"IN FieldCreate", rc)
3326 print*,
"- CALL FieldCreate FOR TARGET GRID XTTS." 3328 typekind=esmf_typekind_r8, &
3330 staggerloc=esmf_staggerloc_center, rc=rc)
3331 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3332 call error_handler(
"IN FieldCreate", rc)
3334 print*,
"- CALL FieldCreate FOR TARGET GRID XZTS." 3336 typekind=esmf_typekind_r8, &
3338 staggerloc=esmf_staggerloc_center, rc=rc)
3339 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3340 call error_handler(
"IN FieldCreate", rc)
3342 print*,
"- CALL FieldCreate FOR TARGET GRID Z_C." 3344 typekind=esmf_typekind_r8, &
3346 staggerloc=esmf_staggerloc_center, rc=rc)
3347 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3348 call error_handler(
"IN FieldCreate", rc)
3350 print*,
"- CALL FieldCreate FOR TARGET GRID ZM." 3352 typekind=esmf_typekind_r8, &
3354 staggerloc=esmf_staggerloc_center, rc=rc)
3355 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3356 call error_handler(
"IN FieldCreate", rc)
3374 integer :: i, j, rc, clb(2), cub(2)
3375 integer(esmf_kind_i8),
pointer :: mask_ptr(:,:)
3377 real(esmf_kind_r8),
pointer :: ice_ptr(:,:)
3378 real(esmf_kind_r8),
pointer :: land_frac_ptr(:,:)
3380 print*,
"- UPDATE TARGET LANDMASK WITH ICE RECORD." 3382 print*,
"- GET TARGET grid sea ice fraction." 3384 farrayptr=ice_ptr, rc=rc)
3385 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3386 call error_handler(
"IN FieldGet", rc)
3388 print*,
"- GET TARGET landmask." 3390 farrayptr=mask_ptr, rc=rc)
3391 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3392 call error_handler(
"IN FieldGet", rc)
3394 print*,
"- GET TARGET land fraction." 3396 computationallbound=clb, &
3397 computationalubound=cub, &
3398 farrayptr=land_frac_ptr, rc=rc)
3399 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3400 call error_handler(
"IN FieldGet", rc)
3402 do j = clb(2), cub(2)
3403 do i = clb(1), cub(1)
3405 mask_ptr(i,j) = ceiling(land_frac_ptr(i,j))
3406 if (mask_ptr(i,j) /= 1)
then 3407 if(ice_ptr(i,j) > 0.0)
then 3427 subroutine ij_to_i_j(ij, itile, jtile, i, j)
3431 integer(esmf_kind_i4),
intent(in) :: ij
3432 integer ,
intent(in) :: itile, jtile
3434 integer ,
intent(out) :: i, j
3437 integer :: pt_loc_this_tile
3439 tile_num = ((ij-1) / (itile*jtile))
3440 pt_loc_this_tile = ij - (tile_num * itile * jtile)
3443 j = (pt_loc_this_tile - 1) / itile + 1
3444 i = mod(pt_loc_this_tile, itile)
3462 subroutine regrid_many(bundle_pre,bundle_post, num_field,route,dozero, &
3463 unmapped_ptr,resetifd)
3471 integer,
intent(in) :: num_field
3472 type(esmf_routehandle),
intent(inout) :: route
3473 type(esmf_fieldbundle),
intent(in) :: bundle_pre, bundle_post
3474 logical,
intent(in) :: dozero(num_field)
3475 logical,
intent(in),
optional :: resetifd
3476 integer(esmf_kind_i4),
intent(inout),
optional :: unmapped_ptr(:)
3478 type(esmf_field) :: field_pre,field_post
3479 real(esmf_kind_r8),
pointer :: tmp_ptr(:,:)
3482 logical :: is2d(num_field)
3483 character(len=50) :: fname
3484 integer :: i, j, k, ij, ind_2d, ind_3d, rc, ndims,n2d, n3d,localpet, l(1), u(1)
3490 if(
present(unmapped_ptr))
then 3491 l = lbound(unmapped_ptr)
3492 u = ubound(unmapped_ptr)
3496 call esmf_fieldbundleget(bundle_pre,i,field_pre,rc=rc)
3497 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3498 call error_handler(
"IN FieldBundleGet", rc)
3500 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3501 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3502 call error_handler(
"IN FieldBundleGet", rc)
3504 call esmf_fieldget(field_post,dimcount=ndims,name=fname,rc=rc)
3505 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3506 call error_handler(
"IN FieldGet", rc)
3508 call esmf_vmgetglobal(vm, rc=rc)
3509 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3510 call error_handler(
"IN VMGetGlobal", rc)
3511 call esmf_vmget(vm, localpet=localpet, rc=rc)
3512 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3513 call error_handler(
"IN VMGet", rc)
3514 if(localpet==0) print*,
"in regrid_many fname = ", fname, ndims
3515 if (ndims == 2) is2d(i) = .true.
3516 if (ndims == 3) is2d(i) = .false.
3519 call esmf_fieldregrid(field_pre, &
3521 routehandle=route, &
3522 termorderflag=esmf_termorder_srcseq, rc=rc)
3523 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3524 call error_handler(
"IN FieldRegrid", rc)
3526 call esmf_fieldregrid(field_pre, &
3528 routehandle=route, &
3529 zeroregion=esmf_region_select, &
3530 termorderflag=esmf_termorder_srcseq, rc=rc)
3531 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3532 call error_handler(
"IN FieldRegrid", rc)
3536 if (
present(resetifd))
then 3539 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3540 call error_handler(
"IN FieldGet", rc)
3541 tmp_ptr = float(nint(tmp_ptr))
3545 n2d = count(is2d(:))
3546 n3d = count(.not.is2d(:))
3547 if(localpet==0) print*, is2d(:)
3548 if (
present(unmapped_ptr))
then 3549 allocate(ptr_2d(n2d))
3550 if (n3d .ne. 0)
allocate(ptr_3d(n3d))
3554 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3555 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3556 call error_handler(
"IN FieldBundleGet", rc)
3557 call esmf_fieldget(field_post, farrayptr=ptr_2d(ind_2d)%p, rc=rc)
3558 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3559 call error_handler(
"IN FieldGet", rc)
3560 call esmf_fieldget(field_post,name=fname,rc=rc)
3561 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3562 call error_handler(
"IN FieldGet", rc)
3563 if (localpet==0) print*,
"in doreplace loop, 2d field = ", trim(fname)
3566 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3567 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3568 call error_handler(
"IN FieldBundleGet", rc)
3569 call esmf_fieldget(field_post,name=fname,rc=rc)
3570 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3571 call error_handler(
"IN FieldGet", rc)
3572 if (localpet==0) print*,
"in doreplace loop, 3d field = ", trim(fname)
3573 call esmf_fieldget(field_post, farrayptr=ptr_3d(ind_3d)%p, rc=rc)
3574 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3575 call error_handler(
"IN FieldGet", rc)
3582 ptr_2d(k)%p(i,j) = -9999.9
3585 ptr_3d(k)%p(i,j,:) = -9999.9
3589 if(n3d .ne. 0)
deallocate(ptr_3d)
3607 subroutine search_many(num_field,bundle_target,tile,search_nums,localpet,latitude, &
3608 terrain_land,soilt_climo, mask)
3616 integer,
intent(in) :: num_field
3617 type(esmf_fieldbundle),
intent(inout) :: bundle_target
3620 real(esmf_kind_r8),
intent(inout),
optional :: terrain_land(
i_target,
j_target)
3621 real(esmf_kind_r8),
intent(inout),
optional :: soilt_climo(
i_target,
j_target)
3624 real(esmf_kind_r8),
allocatable :: field_data_2d(:,:)
3625 real(esmf_kind_r8),
allocatable :: field_data_3d(:,:,:)
3626 integer,
intent(in) :: tile,localpet
3627 integer,
intent(inout) :: search_nums(num_field)
3629 type(esmf_field) :: temp_field
3630 character(len=50) :: fname
3631 integer,
parameter :: sotyp_land_field_num = 224
3632 integer,
parameter :: sst_field_num = 11
3633 integer,
parameter :: terrain_field_num= 7
3634 integer :: j,k, rc, ndims
3638 call esmf_fieldbundleget(bundle_target,k,temp_field, rc=rc)
3639 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3640 call error_handler(
"IN FieldGet", rc)
3641 call esmf_fieldget(temp_field, name=fname, dimcount=ndims,rc=rc)
3642 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3643 call error_handler(
"IN FieldGet", rc)
3644 if (localpet==0)
then 3647 allocate(field_data_2d(0,0))
3649 if (ndims .eq. 2)
then 3650 call esmf_fieldgather(temp_field,field_data_2d,rootpet=0,tile=tile, rc=rc)
3651 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3652 call error_handler(
"IN FieldGather", rc)
3653 if (localpet == 0)
then 3654 if (
present(latitude) .and. search_nums(k).eq.sst_field_num)
then 3657 elseif (
present(terrain_land) .and. search_nums(k) .eq. terrain_field_num)
then 3660 elseif (search_nums(k) .eq. sotyp_land_field_num)
then 3662 if (fname .eq.
"soil_type_target_grid")
then 3666 elseif (
present(soilt_climo))
then 3675 field_data_2d = soilt_climo
3684 call esmf_fieldscatter(temp_field, field_data_2d, rootpet=0, tile=tile,rc=rc)
3685 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3686 call error_handler(
"IN FieldScatter", rc)
3688 if (localpet==0)
then 3691 allocate(field_data_3d(0,0,0))
3695 call esmf_fieldgather(temp_field,field_data_3d,rootpet=0,tile=tile,rc=rc)
3696 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3697 call error_handler(
"IN FieldGather", rc)
3699 if (localpet==0)
then 3701 field_data_2d = field_data_3d(:,:,j)
3703 field_data_3d(:,:,j) = field_data_2d
3706 call esmf_fieldscatter(temp_field, field_data_3d, rootpet=0, tile=tile,rc=rc)
3707 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3708 call error_handler(
"IN FieldScatter", rc)
3709 deallocate(field_data_3d)
3711 deallocate(field_data_2d)
3728 print*,
"- DESTROY LOCAL TARGET GRID SURFACE FIELDS." type(esmf_field), public d_conv_target_grid
Thickness of free convection layer.
integer, public j_target
j dimension of each global tile, or of a nest, target grid.
type(esmf_field), public zm_target_grid
Oceanic mixed layer depth.
This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data...
real, parameter, private hlice
latent heat of fusion
integer, public num_tiles_target_grid
Number of tiles, target grid.
integer, public lsoil_target
Number of soil layers, target grid.
subroutine roughness
Set roughness length at points with some sea ice to 1 cm.
real, parameter, private frz_ice
melting pt sea ice
type(esmf_field), public canopy_mc_target_grid
Canopy moisture content.
type(esmf_field), public z0_water_target_grid
roughness length at open water
type(esmf_field), public f10m_target_grid
log((z0+10)*1/z0) See sfc_diff.f for details.
type(esmf_field), public c_d_target_grid
Coefficient 2 to calculate d(tz)/d(ts).
type(esmf_field), public ifd_target_grid
Model mode index.
integer, public j_input
j-dimension of input grid (or of each global tile)
type(esmf_field), public w_d_target_grid
Coefficient 4 to calculate d(tz)/d(ts).
type(esmf_field), public xtts_target_grid
d(xt)/d(ts).
real, dimension(:), allocatable, public wltsmc_input
Plant wilting point soil moisture content input grid.
logical, public lai_from_climo
If false, interpolate leaf area index from the input data to the target grid instead of using data fr...
type(esmf_field), public srflag_target_grid
Snow/rain flag.
type(esmf_field), public xu_target_grid
u-current content in diurnal thermocline layer.
subroutine, public surface_driver(localpet)
Driver routine to process surface/nst data.
type(esmf_field), public land_frac_target_grid
land fraction, target grid
real, dimension(:), allocatable, public maxsmc_input
Maximum soil moisture content input grid.
real, dimension(:), allocatable, public satpsi_target
Saturated soil potential, target grid.
type(esmf_field), public z0_ice_target_grid
roughness length at sea ice
Module to hold ESMF fields associated with the target grid surface data.
type(esmf_field), public min_veg_greenness_target_grid
minimum annual greenness fraction
type(esmf_field), public tprcp_target_grid
Precipitation.
type(esmf_field), public max_veg_greenness_target_grid
maximum annual greenness fraction
type(esmf_field), public mxsno_albedo_target_grid
maximum snow albedo
Sets up the ESMF grid objects for the input data grid and target FV3 grid.
real, dimension(:), allocatable, public bb_target
Soil 'b' parameter, target grid.
type(esmf_field), public alvwf_target_grid
visible white sky albedo
type(esmf_field) terrain_from_input_grid_land
terrain height interpolated from input grid at all land points
subroutine cleanup_all_target_sfc_data
Free up memory once the target grid surface fields are no longer needed.
type(esmf_field), public latitude_target_grid
latitude of grid center, target grid
Replace undefined values with a valid value.
integer, public i_target
i dimension of each global tile, or of a nest, target grid.
logical, public sotyp_from_climo
If false, interpolate soil type from the input data to the target grid instead of using data from sta...
type(esmf_field), public xzts_target_grid
d(xz)/d(ts).
logical, public minmax_vgfrc_from_climo
If false, interpolate min/max vegetation fraction from the input data to the target grid instead of u...
type(esmf_field), public ice_temp_target_grid
3-d sea ice column temperature
type(esmf_field), public c_0_target_grid
Coefficient 1 to calculate d(tz)/d(ts).
subroutine, public create_surface_esmf_fields
Create ESMF fields for the target grid surface variables.
type(esmf_field), public soilm_liq_target_grid
3-d liquid soil moisture.
type(esmf_grid), public target_grid
target grid esmf grid object.
subroutine update_landmask
Update landmask for sea ice.
type(esmf_field), public alnsf_target_grid
near ir black sky albedo
type(esmf_field), public xz_target_grid
Diurnal thermocline layer thickness.
real, parameter, private grav
gravity
character(len=20), public external_model
The model that the input data is derived from.
type(esmf_field), public z_c_target_grid
Sub-layer cooling thickness.
subroutine, public search(field, mask, idim, jdim, tile, field_num, latitude, terrain_land, soilt_climo)
Replace undefined surface values.
type(esmf_field) soil_type_from_input_grid
soil type interpolated from input grid
type(esmf_field), public lai_target_grid
Leaf area index.
subroutine, public cleanup_static_fields
Free up memory for fields in this module.
subroutine calc_liq_soil_moisture
Compute liquid portion of the total soil moisture.
type(esmf_field), public landmask_target_grid
land mask target grid - '1' some or all land; '0' all non-land
type(esmf_field), public sst_target_grid
SST at open water.
type(esmf_field), public seaice_fract_target_grid
Sea ice fraction.
subroutine rescale_soil_moisture
Adjust soil moisture for changes in soil type between the input and target grids. ...
subroutine adjust_soilt_for_terrain
Adjust soil temperature for changes in terrain height between the input and target grids...
logical, public convert_nst
Convert nst data when true.
type(esmf_field), public snow_liq_equiv_target_grid
Liquid equivalent snow depth at land.
type(esmf_field), public qrain_target_grid
Sensible heat flux due to rainfall.
type(esmf_field), public soilm_tot_target_grid
3-d total soil moisture.
subroutine adjust_soil_levels(localpet)
Adjust soil levels of the input grid if there is a mismatch between input and target grids...
logical, public tg3_from_soil
If false, use lowest level soil temperature for the base soil temperature instead of using data from ...
integer, parameter veg_type_landice_target
Vegetation type category that defines permanent land ice points.
type(esmf_field), public seaice_depth_target_grid
Sea ice depth.
type(esmf_field), public ffmm_target_grid
log((z0+z1)*1/z0) See sfc_diff.f for details.
type(esmf_field), public seaice_skin_temp_target_grid
Sea ice skin temperature.
subroutine, public interp(localpet)
Horizontally interpolate surface fields from input to target FV3 grid using esmf routines.
type(esmf_field), public alvsf_target_grid
visible black sky albedo
real, dimension(:), allocatable, public drysmc_input
Air dry soil moisture content input grid.
real, dimension(:), allocatable, public wltsmc_target
Plant wilting point soil moisture content target grid.
type(esmf_field), public slope_type_target_grid
slope type
Reads static surface climatological data for the target FV3 grid (such as soil type and vegetation ty...
type(esmf_field), public xs_target_grid
Salinity content in diurnal thermocline layer.
logical, public vgfrc_from_climo
If false, interpolate vegetation fraction from the input data to the target grid instead of using dat...
subroutine, public calc_soil_params_driver(localpet)
Driver routine to compute soil parameters for each soil type.
subroutine, public create_nst_esmf_fields
Create ESMF fields for the target grid nst variables.
type(esmf_grid), public input_grid
input grid esmf grid object
type(esmf_field), public ustar_target_grid
Friction velocity.
type(esmf_field), public tref_target_grid
Reference temperature.
type(esmf_field), public q2m_target_grid
2-m specific humidity.
subroutine, public regrid_many(bundle_pre, bundle_post, num_field, route, dozero, unmapped_ptr, resetifd)
Regrid multiple ESMF fields from input to target grid.
subroutine, public nst_land_fill
nst is not active at land or sea ice points.
type(esmf_field), public snow_liq_equiv_at_ice_target_grid
Liquid equivalent snow depth at sea ice.
character(len=25), public input_type
Input data type:
real, parameter, private frz_h2o
melting pt water
Process surface and nst fields.
type(esmf_field), public terrain_target_grid
terrain height target grid
real, dimension(:), allocatable, public refsmc_target
Reference soil moisture content target grid (onset of soil moisture stress).
type(esmf_field), public substrate_temp_target_grid
soil subtrate temperature
type(esmf_field), public veg_greenness_target_grid
vegetation greenness fraction
type(esmf_field), public skin_temp_target_grid
Skin temperature/sst.
type(esmf_field), public xv_target_grid
v-current content in diurnal thermocline layer.
type(esmf_field), public xt_target_grid
Heat content in diurnal thermocline layer.
type(esmf_field), public seamask_target_grid
sea mask target grid - '1' some or all non-land; '0' all land
type(esmf_field), public veg_type_target_grid
vegetation type
subroutine qc_check
Perform some quality control checks and set flag values at non-active points.
type(esmf_field), public snow_depth_at_ice_target_grid
physical snow depth at sea ice.
logical, public vgtyp_from_climo
If false, interpolate vegetation type from the input data to the target grid instead of using data fr...
type(esmf_field), public facwf_target_grid
fractional coverage for weak zenith angle dependent albedo
type(esmf_field) terrain_from_input_grid
terrain height interpolated from input grid
subroutine, public get_static_fields(localpet)
Driver routine to read/time interpolate static/climo fields on the fv3 target grid.
subroutine, public search_many(num_field, bundle_target, tile, search_nums, localpet, latitude, terrain_land, soilt_climo, mask)
Execute the search function for multple fields.
subroutine ij_to_i_j(ij, itile, jtile, i, j)
Convert 1d index to 2d indices.
type(esmf_field), public t2m_target_grid
2-m temperatrure.
real(esmf_kind_r8), parameter, private missing
flag for non-active points.
subroutine, public cleanup_target_nst_data
Free up memory once the target grid nst fields are no longer needed.
type(esmf_field), public soil_temp_target_grid
3-d soil temperature.
real, dimension(:), allocatable, public refsmc_input
Reference soil moisture content input grid (onset of soil moisture stress).
subroutine, public cleanup_target_sfc_data
Free up memory once the target grid surface fields are no longer needed.
type(esmf_field), public alnwf_target_grid
near ir white sky albedo
real, dimension(:), allocatable, public maxsmc_target
Maximum soil moisture content target grid.
real, dimension(:), allocatable, public drysmc_target
Air dry soil moisture content target grid.
type(esmf_field), public dt_cool_target_grid
Sub-layer cooling amount.
integer, public i_input
i-dimension of input grid (or of each global tile)
type(esmf_field), public w_0_target_grid
Coefficient 3 to calculate d(tz)/d(ts).
type(esmf_field), public facsf_target_grid
fractional coverage for strong zenith angle dependent albedo
real, parameter, private blim
soil 'b' parameter limit
type(esmf_field), public snow_depth_target_grid
Physical snow depth at land.
type(esmf_field), public soil_type_target_grid
soil type