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, (/canopy_mc_input_grid, 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 = (/223,66,65/)
1090 dozero=(/.true.,.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)
1305 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1306 call error_handler(
"IN FieldBundleAdd", rc)
1308 call esmf_fieldbundleadd(bundle_nolandice_input, (/skin_temp_input_grid,
terrain_input_grid,&
1309 soil_type_input_grid,soilm_tot_input_grid,soil_temp_input_grid/), rc=rc)
1310 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1311 call error_handler(
"IN FieldBundleAdd", rc)
1315 print*,
"- CALL Field_Regrid ." 1316 call esmf_fieldregrid(soil_type_input_grid, &
1318 routehandle=regrid_land, &
1319 zeroregion=esmf_region_select, &
1320 termorderflag=esmf_termorder_srcseq, rc=rc)
1321 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1322 call error_handler(
"IN FieldRegrid", rc)
1325 farrayptr=soil_type_target_ptr, rc=rc)
1326 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1327 call error_handler(
"IN FieldGet", rc)
1329 l = lbound(unmapped_ptr)
1330 u = ubound(unmapped_ptr)
1334 soil_type_target_ptr(i,j) = -9999.9
1340 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1341 call error_handler(
"IN FieldBundleAdd", rc)
1342 call esmf_fieldbundleadd(bundle_nolandice_input, (/veg_greenness_input_grid/), rc=rc)
1343 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1344 call error_handler(
"IN FieldBundleAdd", rc)
1345 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1346 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1347 call error_handler(
"IN FieldBundleGet", rc)
1348 vgfrc_ind = num_fields
1352 call esmf_fieldbundleadd(bundle_nolandice_target, (/
lai_target_grid/), rc=rc)
1353 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1354 call error_handler(
"IN FieldBundleAdd", rc)
1355 call esmf_fieldbundleadd(bundle_nolandice_input, (/lai_input_grid/), rc=rc)
1356 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1357 call error_handler(
"IN FieldBundleAdd", rc)
1358 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1359 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1360 call error_handler(
"IN FieldBundleGet", rc)
1361 lai_ind = num_fields
1366 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1367 call error_handler(
"IN FieldBundleAdd", rc)
1368 call esmf_fieldbundleadd(bundle_nolandice_input, (/max_veg_greenness_input_grid/), rc=rc)
1369 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1370 call error_handler(
"IN FieldBundleAdd", rc)
1373 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1374 call error_handler(
"IN FieldBundleAdd", rc)
1375 call esmf_fieldbundleadd(bundle_nolandice_input, (/min_veg_greenness_input_grid/), rc=rc)
1376 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1377 call error_handler(
"IN FieldBundleAdd", rc)
1379 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1380 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1381 call error_handler(
"IN FieldBundleGet", rc)
1383 mmvg_ind = num_fields-1
1386 call esmf_fieldbundleget(bundle_nolandice_target,fieldcount=num_fields,rc=rc)
1387 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1388 call error_handler(
"IN FieldBundleGet", rc)
1390 allocate(search_nums(num_fields))
1391 allocate(dozero(num_fields))
1393 search_nums(1:5) = (/85,7,224,85,86/)
1394 dozero(1:5) = (/.false.,.false.,.true.,.true.,.false./)
1397 search_nums(vgfrc_ind) = 224
1398 dozero(vgfrc_ind) = .true.
1402 search_nums(lai_ind) = 229
1403 dozero(lai_ind) = .true.
1407 search_nums(mmvg_ind) = 227
1408 dozero(mmvg_ind) = .true.
1410 search_nums(mmvg_ind+1) = 228
1411 dozero(mmvg_ind+1) = .true.
1414 call regrid_many(bundle_nolandice_input,bundle_nolandice_target,num_fields,regrid_land,dozero, &
1415 unmapped_ptr=unmapped_ptr)
1417 call esmf_fieldbundledestroy(bundle_nolandice_input,rc=rc)
1418 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1419 call error_handler(
"IN FieldBundleDestroy", rc)
1421 if (localpet == 0)
then 1424 allocate (veg_type_target_one_tile(0,0))
1429 print*,
"- CALL FieldGather FOR TARGET LANDMASK TILE: ", tile
1431 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1432 call error_handler(
"IN FieldGather", rc)
1434 print*,
"- CALL FieldGather FOR TARGET VEG TYPE TILE: ", tile
1435 call esmf_fieldgather(
veg_type_target_grid, veg_type_target_one_tile, rootpet=0, tile=tile, rc=rc)
1436 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1437 call error_handler(
"IN FieldGather", rc)
1439 if (localpet == 0)
then 1443 print*,
"- CALL FieldGather FOR SOIL TYPE TARGET GRID, TILE: ", tile
1445 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1446 call error_handler(
"IN FieldGather", rc)
1447 if (localpet==0)
then 1448 call search_many(num_fields,bundle_nolandice_target,tile,search_nums,localpet, &
1449 soilt_climo=data_one_tile2, mask=mask_target_one_tile)
1451 call search_many(num_fields,bundle_nolandice_target, tile,search_nums,localpet)
1454 print*,
"- CALL FieldGather FOR TARGET GRID TOTAL SOIL MOISTURE, TILE: ", tile
1456 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1457 call error_handler(
"IN FieldGather", rc)
1459 if (localpet == 0)
then 1461 data_one_tile = data_one_tile_3d(:,:,j)
1463 data_one_tile_3d(:,:,j) = data_one_tile
1467 print*,
"- CALL FieldGather FOR TARGET GRID SOIL TEMPERATURE, TILE: ", tile
1469 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1470 call error_handler(
"IN FieldGather", rc)
1473 print*,
"- CALL FieldScatter FOR TARGET GRID SUBSTRATE TEMPERATURE, TILE: ", tile
1475 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1476 call error_handler(
"IN FieldScatter", rc)
1480 print*,
"- CALL FieldGather FOR SOIL TYPE TARGET GRID LAND, TILE: ",tile
1482 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1483 call error_handler(
"IN FieldGather", rc)
1485 if (localpet == 0)
then 1489 print*,
"- CALL FieldScatter FOR SOIL TYPE TARGET GRID, TILE: ", tile
1491 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
1492 call error_handler(
"IN FieldScatter", rc)
1497 deallocate(search_nums)
1498 call esmf_fieldbundledestroy(bundle_nolandice_target,rc=rc)
1499 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1500 call error_handler(
"IN FieldBundleDestroy", rc)
1502 print*,
"- CALL FieldRegridRelease." 1503 call esmf_fieldregridrelease(routehandle=regrid_land, rc=rc)
1504 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1505 call error_handler(
"IN FieldRegridRelease", rc)
1507 deallocate(veg_type_target_one_tile)
1509 deallocate(data_one_tile, data_one_tile2)
1510 deallocate(data_one_tile_3d)
1511 deallocate(mask_target_one_tile)
1535 integer :: clb(3), cub(3), rc
1536 integer :: i, j, n, soil_type
1538 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1541 real(esmf_kind_r8),
pointer :: soilm_liq_ptr(:,:,:)
1542 real(esmf_kind_r8),
pointer :: soilm_tot_ptr(:,:,:)
1543 real(esmf_kind_r8),
pointer :: soil_temp_ptr(:,:,:)
1544 real(esmf_kind_r8),
pointer :: soil_type_ptr(:,:)
1545 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
1547 print*,
"- COMPUTE LIQUID PORTION OF TOTAL SOIL MOISTURE." 1549 print*,
"- CALL FieldGet FOR TOTAL SOIL MOISTURE." 1551 computationallbound=clb, &
1552 computationalubound=cub, &
1553 farrayptr=soilm_tot_ptr, rc=rc)
1554 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1555 call error_handler(
"IN FieldGet", rc)
1557 print*,
"- CALL FieldGet FOR LIQUID SOIL MOISTURE." 1559 farrayptr=soilm_liq_ptr, rc=rc)
1560 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1561 call error_handler(
"IN FieldGet", rc)
1563 print*,
"- CALL FieldGet FOR SOIL TEMPERATURE." 1565 farrayptr=soil_temp_ptr, rc=rc)
1566 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1567 call error_handler(
"IN FieldGet", rc)
1569 print*,
"- CALL FieldGet FOR VEGETATION TYPE." 1571 farrayptr=veg_type_ptr, rc=rc)
1572 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1573 call error_handler(
"IN FieldGet", rc)
1575 print*,
"- CALL FieldGet FOR SOIL TYPE." 1577 farrayptr=soil_type_ptr, rc=rc)
1578 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1579 call error_handler(
"IN FieldGet", rc)
1581 print*,
"- CALL FieldGet FOR LANDMASK." 1583 farrayptr=landmask_ptr, rc=rc)
1584 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1585 call error_handler(
"IN FieldGet", rc)
1587 do j = clb(2), cub(2)
1588 do i = clb(1), cub(1)
1596 soil_type = nint(soil_type_ptr(i,j))
1598 do n = clb(3), cub(3)
1600 if (soil_temp_ptr(i,j,n) < (
frz_h2o-0.0001))
then 1607 ((soil_temp_ptr(i,j,n)-
frz_h2o)/soil_temp_ptr(i,j,n)))** &
1610 if (fk .lt. 0.02) fk = 0.02
1612 soilm_liq_ptr(i,j,n) = min( fk, soilm_tot_ptr(i,j,n) )
1620 soilm_liq_ptr(i,j,n) =
frh2o(soil_temp_ptr(i,j,n), &
1621 soilm_tot_ptr(i,j,n), soilm_liq_ptr(i,j,n), &
1627 soilm_liq_ptr(i,j,n) = soilm_tot_ptr(i,j,n)
1664 FUNCTION frh2o (TKELV,SMC,SH2O,SMCMAX,BEXP,PSIS)
1681 REAL(esmf_kind_r8) :: sh2o
1682 REAL(esmf_kind_r8) :: smc
1686 REAL(esmf_kind_r8) :: tkelv
1688 REAL,
PARAMETER :: ck = 8.0
1689 REAL,
PARAMETER :: error = 0.005
1707 IF (ck .NE. 0.0)
THEN 1722 IF (swl .GT. (smc-0.02)) swl = smc-0.02
1723 IF (swl .LT. 0.) swl = 0.
1729 DO WHILE ( (nlog .LT. 10) .AND. (kcount .EQ. 0) )
1732 df = log(( psis*
grav/
hlice ) * ( ( 1.+ck*swl )**2. ) * &
1733 ( smcmax/(smc-swl) )**bx) - log(-(tkelv-
frz_h2o)/tkelv)
1734 denom = 2. * ck / ( 1.+ck*swl ) + bx / ( smc - swl )
1735 swlk = swl - df/denom
1741 IF (swlk .GT. (smc-0.02)) swlk = smc - 0.02
1742 IF (swlk .LT. 0.) swlk = 0.
1748 dswl = abs(swlk-swl)
1756 IF ( dswl .LE. error )
THEN 1782 IF (kcount .EQ. 0)
THEN 1785 ((tkelv-
frz_h2o)/tkelv))**(-1/bx))*smcmax
1787 IF (fk .LT. 0.02) fk = 0.02
1789 frh2o = min(fk, smc)
1819 integer :: clb(3), cub(3), i, j, k, rc
1820 integer :: soilt_input, soilt_target
1821 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1823 real(esmf_kind_r8),
pointer :: soilm_tot_ptr(:,:,:)
1824 real(esmf_kind_r8),
pointer :: soil_type_input_ptr(:,:)
1825 real(esmf_kind_r8),
pointer :: soil_type_target_ptr(:,:)
1826 real(esmf_kind_r8),
pointer :: veg_greenness_ptr(:,:)
1827 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
1828 real :: f1, fn, smcdir, smctra
1830 print*,
"- RESCALE SOIL MOISTURE FOR CHANGES IN SOIL TYPE." 1832 print*,
"- CALL FieldGet FOR TOTAL SOIL MOISTURE." 1834 computationallbound=clb, &
1835 computationalubound=cub, &
1836 farrayptr=soilm_tot_ptr, rc=rc)
1837 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1838 call error_handler(
"IN FieldGet", rc)
1840 print*,
"- CALL FieldGet FOR LAND MASK." 1842 farrayptr=landmask_ptr, rc=rc)
1843 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1844 call error_handler(
"IN FieldGet", rc)
1846 print*,
"- CALL FieldGet FOR VEGETATION TYPE." 1848 farrayptr=veg_type_ptr, rc=rc)
1849 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1850 call error_handler(
"IN FieldGet", rc)
1852 print*,
"- CALL FieldGet FOR VEGETATION GREENNESS." 1854 farrayptr=veg_greenness_ptr, rc=rc)
1855 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1856 call error_handler(
"IN FieldGet", rc)
1858 print*,
"- CALL FieldGet FOR TARGET GRID SOIL TYPE." 1860 farrayptr=soil_type_target_ptr, rc=rc)
1861 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1862 call error_handler(
"IN FieldGet", rc)
1864 print*,
"- CALL FieldGet FOR SOIL TYPE FROM INPUT GRID." 1866 farrayptr=soil_type_input_ptr, rc=rc)
1867 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1868 call error_handler(
"IN FieldGet", rc)
1870 do j = clb(2), cub(2)
1871 do i = clb(1), cub(1)
1879 soilt_target = nint(soil_type_target_ptr(i,j))
1880 soilt_input = nint(soil_type_input_ptr(i,j))
1888 if (soilt_target /= soilt_input)
then 1893 f1=(soilm_tot_ptr(i,j,1)-
drysmc_input(soilt_input)) / &
1903 if (soilm_tot_ptr(i,j,1) <
refsmc_input(soilt_input))
then 1904 f1=(soilm_tot_ptr(i,j,1) -
wltsmc_input(soilt_input)) / &
1909 f1=(soilm_tot_ptr(i,j,1) -
refsmc_input(soilt_input)) / &
1919 soilm_tot_ptr(i,j,1) = ((1.0 - veg_greenness_ptr(i,j)) * smcdir) + &
1920 (veg_greenness_ptr(i,j) * smctra)
1930 if (soilm_tot_ptr(i,j,k) <
refsmc_input(soilt_input))
then 1931 fn = (soilm_tot_ptr(i,j,k) -
wltsmc_input(soilt_input)) / &
1936 fn = (soilm_tot_ptr(i,j,k) -
refsmc_input(soilt_input)) / &
1949 soilm_tot_ptr(i,j,1)=min(soilm_tot_ptr(i,j,1),
maxsmc_target(soilt_target))
1950 soilm_tot_ptr(i,j,1)=max(
drysmc_target(soilt_target),soilm_tot_ptr(i,j,1))
1953 soilm_tot_ptr(i,j,k)=min(soilm_tot_ptr(i,j,k),
maxsmc_target(soilt_target))
1954 soilm_tot_ptr(i,j,k)=max(
wltsmc_target(soilt_target),soilm_tot_ptr(i,j,k))
1979 integer :: clb(3), cub(3), i, j, k, rc
1980 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
1982 real,
parameter :: lapse_rate = 6.5e-03
1983 real :: terrain_diff
1984 real(esmf_kind_r8),
pointer :: terrain_input_ptr(:,:)
1985 real(esmf_kind_r8),
pointer :: terrain_target_ptr(:,:)
1986 real(esmf_kind_r8),
pointer :: veg_type_target_ptr(:,:)
1987 real(esmf_kind_r8),
pointer :: soil_temp_target_ptr(:,:,:)
1989 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 1991 farrayptr=landmask_ptr, rc=rc)
1992 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1993 call error_handler(
"IN FieldGet", rc)
1995 print*,
"- CALL FieldGet FOR TARGET GRID VEGETATION TYPE." 1997 farrayptr=veg_type_target_ptr, rc=rc)
1998 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
1999 call error_handler(
"IN FieldGet", rc)
2001 print*,
"- CALL FieldGet FOR TARGET GRID TERRAIN." 2003 farrayptr=terrain_target_ptr, rc=rc)
2004 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2005 call error_handler(
"IN FieldGet", rc)
2007 print*,
"- CALL FieldGet FOR TERRAIN INTERP TO TARGET GRID." 2009 farrayptr=terrain_input_ptr, rc=rc)
2010 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2011 call error_handler(
"IN FieldGet", rc)
2013 print*,
"- CALL FieldGet FOR SOIL TEMP TARGET GRID." 2015 computationallbound=clb, &
2016 computationalubound=cub, &
2017 farrayptr=soil_temp_target_ptr, rc=rc)
2018 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2019 call error_handler(
"IN FieldGet", rc)
2021 do j = clb(2), cub(2)
2022 do i = clb(1), cub(1)
2023 if (landmask_ptr(i,j) == 1)
then 2024 terrain_diff = abs(terrain_input_ptr(i,j) - terrain_target_ptr(i,j))
2025 if (terrain_diff > 100.0)
then 2026 do k = clb(3), cub(3)
2027 soil_temp_target_ptr(i,j,k) = soil_temp_target_ptr(i,j,k) + &
2028 ((terrain_input_ptr(i,j) - terrain_target_ptr(i,j)) * lapse_rate)
2030 soil_temp_target_ptr(i,j,k) = min(soil_temp_target_ptr(i,j,k), 273.16)
2048 use sfc_input_data,
only : lsoil_input, soil_temp_input_grid, &
2049 soilm_liq_input_grid, soilm_tot_input_grid
2051 integer,
intent(in) :: localpet
2052 character(len=500) :: msg
2053 character(len=2) :: lsoil_input_ch, lsoil_target_ch
2055 real(esmf_kind_r8) :: tmp(i_input,j_input), &
2056 data_one_tile(i_input,j_input,lsoil_input), &
2057 tmp3d(i_input,j_input,lsoil_target)
2058 if (lsoil_input == 9 .and. lsoil_target == 4)
then 2059 print*,
"CONVERTING FROM 9 INPUT SOIL LEVELS TO 4 TARGET SOIL LEVELS" 2060 call esmf_fieldgather(soil_temp_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2061 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2062 call error_handler(
"IN FieldGather", rc)
2064 call esmf_fielddestroy(soil_temp_input_grid,rc=rc)
2065 soil_temp_input_grid = esmf_fieldcreate(
input_grid, &
2066 typekind=esmf_typekind_r8, &
2067 staggerloc=esmf_staggerloc_center, &
2068 ungriddedlbound=(/1/), &
2069 ungriddedubound=(/lsoil_target/), rc=rc)
2072 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2073 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2074 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2075 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2076 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2077 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2078 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2079 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2080 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2081 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2082 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2085 call esmf_fieldscatter(soil_temp_input_grid, tmp3d, rootpet=0, rc=rc)
2086 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2087 call error_handler(
"IN FieldScatter", rc)
2089 call esmf_fieldgather(soilm_tot_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2090 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2091 call error_handler(
"IN FieldGather", rc)
2093 call esmf_fielddestroy(soilm_tot_input_grid,rc=rc)
2094 soilm_tot_input_grid = esmf_fieldcreate(
input_grid, &
2095 typekind=esmf_typekind_r8, &
2096 staggerloc=esmf_staggerloc_center, &
2097 ungriddedlbound=(/1/), &
2098 ungriddedubound=(/lsoil_target/), rc=rc)
2100 if(localpet==0)
then 2101 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2102 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2103 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2104 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2105 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2106 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2107 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2108 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2109 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2110 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2111 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2114 call esmf_fieldscatter(soilm_tot_input_grid, tmp3d, rootpet=0, rc=rc)
2115 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2116 call error_handler(
"IN FieldScatter", rc)
2118 call esmf_fieldgather(soilm_liq_input_grid, data_one_tile, rootpet=0, tile=1, rc=rc)
2119 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2120 call error_handler(
"IN FieldGather", rc)
2122 call esmf_fielddestroy(soilm_liq_input_grid,rc=rc)
2123 soilm_liq_input_grid = esmf_fieldcreate(
input_grid, &
2124 typekind=esmf_typekind_r8, &
2125 staggerloc=esmf_staggerloc_center, &
2126 ungriddedlbound=(/1/), &
2127 ungriddedubound=(/lsoil_target/), rc=rc)
2128 if(localpet==0)
then 2129 tmp3d(:,:,1)= (data_one_tile(:,:,1) + data_one_tile(:,:,2))/2.0 * 0.1 + &
2130 (data_one_tile(:,:,2) + data_one_tile(:,:,3))/2.0 * 0.3 + &
2131 (data_one_tile(:,:,3) + data_one_tile(:,:,4))/2.0 * 0.6
2132 tmp = (data_one_tile(:,:,6) - data_one_tile(:,:,5)) / 30.0 * 10.0 + data_one_tile(:,:,5)
2133 tmp3d(:,:,2)= (data_one_tile(:,:,4) + data_one_tile(:,:,5)) / 2.0 * 0.75 + &
2134 (data_one_tile(:,:,5) + tmp) / 2.0 * 0.25
2135 tmp3d(:,:,3)= (tmp + data_one_tile(:,:,6)) /2.0 * (1.0/3.0) + &
2136 (data_one_tile(:,:,6) + data_one_tile(:,:,7)) / 2.0 * (2.0/3.0)
2137 tmp = (data_one_tile(:,:,9) - data_one_tile(:,:,9)) / 140.0 * 40.0 + data_one_tile(:,:,8)
2138 tmp3d(:,:,4)= (data_one_tile(:,:,7) + data_one_tile(:,:,8)) / 2.0 * 0.6 + &
2139 (data_one_tile(:,:,8) + tmp) / 2.0 * 0.4
2142 call esmf_fieldscatter(soilm_liq_input_grid, tmp3d, rootpet=0, rc=rc)
2143 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2144 call error_handler(
"IN FieldScatter", rc)
2146 elseif (lsoil_input /= lsoil_target)
then 2148 write(lsoil_input_ch,
'(i2)') lsoil_input
2149 write(lsoil_target_ch,
'(i2)') lsoil_target
2150 msg=
"NUMBER OF SOIL LEVELS IN INPUT " // lsoil_input_ch //
" AND OUTPUT " &
2151 // lsoil_target_ch //
" MUST EITHER BE EQUAL OR 9 AND 4 RESPECTIVELY." 2152 call error_handler(msg, rc)
2168 integer :: clb(2), cub(2), i, j, rc
2169 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
2170 integer(esmf_kind_i8),
pointer :: seamask_ptr(:,:)
2172 real(esmf_kind_r8),
pointer :: data_ptr2(:,:)
2173 real(esmf_kind_r8),
pointer :: data_ptr3(:,:)
2174 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2176 print*,
"- SET ROUGHNESS." 2178 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 2180 computationallbound=clb, &
2181 computationalubound=cub, &
2182 farrayptr=landmask_ptr, rc=rc)
2183 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2184 call error_handler(
"IN FieldGet", rc)
2186 print*,
"- CALL FieldGet FOR TARGET GRID SEA ICE." 2188 farrayptr=fice_ptr, rc=rc)
2189 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2190 call error_handler(
"IN FieldGet", rc)
2192 print*,
"- CALL FieldGet FOR TARGET GRID Z0 WATER." 2194 farrayptr=data_ptr3, rc=rc)
2195 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2196 call error_handler(
"IN FieldGet", rc)
2198 print*,
"- CALL FieldGet FOR TARGET SEA MASK." 2200 farrayptr=seamask_ptr, rc=rc)
2201 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2202 call error_handler(
"IN FieldGet", rc)
2204 print*,
"- CALL FieldGet FOR TARGET GRID Z0 ICE." 2206 farrayptr=data_ptr2, rc=rc)
2207 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2208 call error_handler(
"IN FieldGet", rc)
2212 do j = clb(2), cub(2)
2213 do i = clb(1), cub(1)
2214 if (fice_ptr(i,j) > 0.0)
then 2215 data_ptr2(i,j) = 1.0
2225 do j = clb(2), cub(2)
2226 do i = clb(1), cub(1)
2227 if (fice_ptr(i,j) == 1.0_esmf_kind_r8 .or. seamask_ptr(i,j) == 0)
then 2261 integer :: clb(2), cub(2), i, j, rc
2262 integer(esmf_kind_i8),
pointer :: landmask_ptr(:,:)
2263 integer(esmf_kind_i8),
pointer :: seamask_ptr(:,:)
2265 real(esmf_kind_r8),
pointer :: data_ptr(:,:)
2266 real(esmf_kind_r8),
pointer :: data3d_ptr(:,:,:)
2267 real(esmf_kind_r8),
pointer :: ice_ptr(:,:,:)
2268 real(esmf_kind_r8),
pointer :: soilmt_ptr(:,:,:)
2269 real(esmf_kind_r8),
pointer :: soilml_ptr(:,:,:)
2270 real(esmf_kind_r8),
pointer :: veg_greenness_ptr(:,:)
2271 real(esmf_kind_r8),
pointer :: veg_type_ptr(:,:)
2272 real(esmf_kind_r8),
pointer :: seaice_skint_ptr(:,:)
2273 real(esmf_kind_r8),
pointer :: skint_ptr(:,:)
2274 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2275 real(esmf_kind_r8),
pointer :: hice_ptr(:,:)
2276 real(esmf_kind_r8),
pointer :: tg3_ptr(:,:)
2277 real(esmf_kind_r8),
pointer :: snod_ptr(:,:)
2278 real(esmf_kind_r8),
pointer :: snol_ptr(:,:)
2280 print*,
'- PERFORM QC CHECK' 2282 print*,
"- CALL FieldGet FOR TARGET GRID LAND-SEA MASK." 2284 computationallbound=clb, &
2285 computationalubound=cub, &
2286 farrayptr=landmask_ptr, rc=rc)
2287 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2288 call error_handler(
"IN FieldGet", rc)
2290 print*,
"- CALL FieldGet FOR TARGET GRID SEA MASK." 2292 farrayptr=seamask_ptr, rc=rc)
2293 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2294 call error_handler(
"IN FieldGet", rc)
2296 print*,
"- CALL FieldGet FOR TARGET GRID SEA ICE FRACTION." 2298 farrayptr=fice_ptr, rc=rc)
2299 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2300 call error_handler(
"IN FieldGet", rc)
2302 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SLOPE TYPE." 2304 farrayptr=data_ptr, rc=rc)
2305 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2306 call error_handler(
"IN FieldGet", rc)
2308 do j = clb(2), cub(2)
2309 do i = clb(1), cub(1)
2310 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2314 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SOIL TYPE." 2316 farrayptr=data_ptr, rc=rc)
2317 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2318 call error_handler(
"IN FieldGet", rc)
2320 do j = clb(2), cub(2)
2321 do i = clb(1), cub(1)
2322 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2326 print*,
"- SET NON-LAND FLAG FOR TARGET GRID VEGETATION TYPE." 2328 farrayptr=veg_type_ptr, rc=rc)
2329 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2330 call error_handler(
"IN FieldGet", rc)
2332 do j = clb(2), cub(2)
2333 do i = clb(1), cub(1)
2334 if (landmask_ptr(i,j) == 0) veg_type_ptr(i,j) = 0.0
2338 print*,
"- SET TARGET GRID ALVSF FLAG AT NON-LAND." 2340 farrayptr=data_ptr, rc=rc)
2341 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2342 call error_handler(
"IN FieldGet", rc)
2344 do j = clb(2), cub(2)
2345 do i = clb(1), cub(1)
2346 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2350 print*,
"- SET TARGET GRID ALVWF FLAG AT NON-LAND." 2352 farrayptr=data_ptr, rc=rc)
2353 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2354 call error_handler(
"IN FieldGet", rc)
2356 do j = clb(2), cub(2)
2357 do i = clb(1), cub(1)
2358 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2362 print*,
"- SET TARGET GRID ALNSF FLAG AT NON-LAND." 2364 farrayptr=data_ptr, rc=rc)
2365 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2366 call error_handler(
"IN FieldGet", rc)
2368 do j = clb(2), cub(2)
2369 do i = clb(1), cub(1)
2370 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2374 print*,
"- SET TARGET GRID ALNWF FLAG AT NON-LAND." 2376 farrayptr=data_ptr, rc=rc)
2377 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2378 call error_handler(
"IN FieldGet", rc)
2380 do j = clb(2), cub(2)
2381 do i = clb(1), cub(1)
2382 if (landmask_ptr(i,j) == 0) data_ptr(i,j) =
missing 2386 print*,
"- SET NON-LAND FLAG FOR TARGET GRID FACSF." 2388 farrayptr=data_ptr, rc=rc)
2389 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2390 call error_handler(
"IN FieldGet", rc)
2392 do j = clb(2), cub(2)
2393 do i = clb(1), cub(1)
2394 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2398 print*,
"- SET NON-LAND FLAG FOR TARGET GRID FACWF." 2400 farrayptr=data_ptr, rc=rc)
2401 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2402 call error_handler(
"IN FieldGet", rc)
2404 do j = clb(2), cub(2)
2405 do i = clb(1), cub(1)
2406 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2410 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MAXIMUM GREENNESS." 2412 farrayptr=data_ptr, rc=rc)
2413 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2414 call error_handler(
"IN FieldGet", rc)
2416 do j = clb(2), cub(2)
2417 do i = clb(1), cub(1)
2418 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2422 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MINIMUM GREENNESS." 2424 farrayptr=data_ptr, rc=rc)
2425 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2426 call error_handler(
"IN FieldGet", rc)
2428 do j = clb(2), cub(2)
2429 do i = clb(1), cub(1)
2430 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2434 print*,
"- SET NON-LAND FLAG FOR TARGET GRID VEGETATION GREENNESS." 2436 farrayptr=veg_greenness_ptr, rc=rc)
2437 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2438 call error_handler(
"IN FieldGet", rc)
2440 do j = clb(2), cub(2)
2441 do i = clb(1), cub(1)
2442 if (landmask_ptr(i,j) == 0) veg_greenness_ptr(i,j) = 0.0
2446 print*,
"- SET NON-LAND FLAG FOR TARGET GRID MAX SNOW ALBEDO." 2448 farrayptr=data_ptr, rc=rc)
2449 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2450 call error_handler(
"IN FieldGet", rc)
2452 do j = clb(2), cub(2)
2453 do i = clb(1), cub(1)
2454 if (landmask_ptr(i,j) == 0) data_ptr(i,j) = 0.0
2458 print*,
"- ZERO OUT TARGET GRID CANOPY MOISTURE CONTENT WHERE NO PLANTS." 2460 farrayptr=data_ptr, rc=rc)
2461 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2462 call error_handler(
"IN FieldGet", rc)
2466 do j = clb(2), cub(2)
2467 do i = clb(1), cub(1)
2468 if (veg_greenness_ptr(i,j) <= 0.01) data_ptr(i,j) = 0.0
2472 print*,
"- CALL FieldGet FOR TARGET GRID ICE SKIN TEMP." 2474 farrayptr=seaice_skint_ptr, rc=rc)
2475 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2476 call error_handler(
"IN FieldGet", rc)
2478 print*,
"- CALL FieldGet FOR TARGET GRID SKIN TEMP." 2480 farrayptr=skint_ptr, rc=rc)
2481 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2482 call error_handler(
"IN FieldGet", rc)
2484 print*,
"- CALL FieldGet FOR TARGET GRID ICE DEPTH." 2486 farrayptr=hice_ptr, rc=rc)
2487 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2488 call error_handler(
"IN FieldGet", rc)
2494 print*,
"- SET TARGET GRID SEA ICE DEPTH TO ZERO AT NON-ICE POINTS." 2496 do j = clb(2), cub(2)
2497 do i = clb(1), cub(1)
2498 if (fice_ptr(i,j) == 0.0)
then 2499 if (seamask_ptr(i,j) == 0)
then 2500 seaice_skint_ptr(i,j) =
missing 2502 seaice_skint_ptr(i,j) =
frz_ice 2509 print*,
"- SET TARGET GRID SST FLAG VALUE." 2511 farrayptr=data_ptr, rc=rc)
2512 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2513 call error_handler(
"IN FieldGet", rc)
2517 do j = clb(2), cub(2)
2518 do i = clb(1), cub(1)
2519 if (fice_ptr(i,j) == 1.0_esmf_kind_r8 .or. seamask_ptr(i,j) == 0.0)
then 2525 print*,
"- SET MISSING FLAG AT TARGET GRID SUBSTRATE TEMP." 2527 farrayptr=tg3_ptr, rc=rc)
2528 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2529 call error_handler(
"IN FieldGet", rc)
2531 do j = clb(2), cub(2)
2532 do i = clb(1), cub(1)
2533 if (landmask_ptr(i,j) == 0.0)
then 2539 print*,
"- SET MISSING FLAG AT TARGET GRID SNOW FIELDS AT ICE." 2541 print*,
"- CALL FieldGet FOR TARGET GRID SNOW DEPTH AT ICE." 2543 farrayptr=snod_ptr, rc=rc)
2544 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2545 call error_handler(
"IN FieldGet", rc)
2547 print*,
"- CALL FieldGet FOR TARGET GRID SNOW LIQ EQUIV AT ICE." 2549 farrayptr=snol_ptr, rc=rc)
2550 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2551 call error_handler(
"IN FieldGet", rc)
2553 do j = clb(2), cub(2)
2554 do i = clb(1), cub(1)
2555 if (fice_ptr(i,j) == 0.0)
then 2562 print*,
"- SET NON-LAND FLAG AT TARGET GRID SNOW DEPTH." 2564 farrayptr=data_ptr, rc=rc)
2565 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2566 call error_handler(
"IN FieldGet", rc)
2568 do j = clb(2), cub(2)
2569 do i = clb(1), cub(1)
2570 if (landmask_ptr(i,j) == 0)
then 2576 print*,
"- SET NON-LAND FLAG AT TARGET GRID SNOW LIQ." 2578 farrayptr=data_ptr, rc=rc)
2579 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2580 call error_handler(
"IN FieldGet", rc)
2582 do j = clb(2), cub(2)
2583 do i = clb(1), cub(1)
2584 if (landmask_ptr(i,j) == 0)
then 2590 print*,
"- SET NON-LAND FLAG VALUE FOR TARGET GRID TOTAL SOIL MOISTURE." 2592 farrayptr=soilmt_ptr, rc=rc)
2593 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2594 call error_handler(
"IN FieldGet", rc)
2596 print*,
"- SET NON-LAND FLAG VALUE FOR TARGET GRID LIQUID SOIL MOISTURE." 2598 farrayptr=soilml_ptr, rc=rc)
2599 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2600 call error_handler(
"IN FieldGet", rc)
2602 do j = clb(2), cub(2)
2603 do i = clb(1), cub(1)
2604 if (landmask_ptr(i,j) == 0 .or. &
2606 soilmt_ptr(i,j,:) = 1.0
2607 soilml_ptr(i,j,:) = 1.0
2612 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SOIL TEMPERATURE." 2614 farrayptr=data3d_ptr, rc=rc)
2615 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2616 call error_handler(
"IN FieldGet", rc)
2618 do j = clb(2), cub(2)
2619 do i = clb(1), cub(1)
2620 if (landmask_ptr(i,j) == 0)
then 2626 print*,
"- SET NON-ICE FLAG FOR TARGET GRID ICE COLUMN TEMPERATURE." 2628 farrayptr=ice_ptr, rc=rc)
2629 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2630 call error_handler(
"IN FieldGet", rc)
2636 do j = clb(2), cub(2)
2637 do i = clb(1), cub(1)
2638 if (fice_ptr(i,j) == 0.0)
then 2639 if (seamask_ptr(i,j) == 0)
then 2648 print*,
"- SET NON-LAND FLAG FOR TARGET GRID SKIN TEMPERATURE." 2650 do j = clb(2), cub(2)
2651 do i = clb(1), cub(1)
2652 if (landmask_ptr(i,j) == 0)
then 2672 integer(esmf_kind_i8),
pointer :: mask_ptr(:,:)
2674 integer,
PARAMETER :: num_nst_fields_minus2 = 16
2675 integer,
PARAMETER :: xz_fill = 30.0
2676 integer,
PARAMETER :: nst_fill = 0.0
2678 real(esmf_kind_r8),
pointer :: data_ptr(:,:)
2679 real(esmf_kind_r8),
pointer :: fice_ptr(:,:)
2680 real(esmf_kind_r8),
pointer :: skint_ptr(:,:)
2682 type(esmf_field) :: temp_field
2683 type(esmf_fieldbundle) :: nst_bundle
2685 print*,
"- CALL FieldGet FOR TARGET GRID SEAMASK." 2687 farrayptr=mask_ptr, rc=rc)
2688 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2689 call error_handler(
"IN FieldGet", rc)
2691 print*,
"- CALL FieldGet FOR TARGET GRID SEAICE FRACT." 2693 farrayptr=fice_ptr, rc=rc)
2694 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2695 call error_handler(
"IN FieldGet", rc)
2697 nst_bundle = esmf_fieldbundlecreate(name=
"nst_bundle", rc=rc)
2698 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2699 call error_handler(
"IN FieldBundleCreate", rc)
2706 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2707 call error_handler(
"IN FieldBundleAdd", rc)
2709 print*,
"- CALL FieldGet FOR TREF." 2711 farrayptr=data_ptr, rc=rc)
2712 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2713 call error_handler(
"IN FieldGet", rc)
2715 print*,
"- CALL FieldGet FOR SKIN T." 2717 farrayptr=skint_ptr, rc=rc)
2718 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2719 call error_handler(
"IN FieldGet", rc)
2721 where(mask_ptr == 0) data_ptr = skint_ptr
2722 where(fice_ptr > 0.0) data_ptr =
frz_ice 2726 print*,
"- CALL FieldGet FOR XZ." 2728 farrayptr=data_ptr, rc=rc)
2729 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2730 call error_handler(
"IN FieldGet", rc)
2732 where(mask_ptr == 0) data_ptr = xz_fill
2733 where(fice_ptr > 0.0) data_ptr = xz_fill
2735 do i = 1,num_nst_fields_minus2
2737 call esmf_fieldbundleget(nst_bundle,i,temp_field,rc=rc)
2738 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2739 call error_handler(
"IN FieldBundleGet", rc)
2741 call esmf_fieldget(temp_field,farrayptr=data_ptr,rc=rc)
2742 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2743 call error_handler(
"IN FieldGet", rc)
2745 where(mask_ptr == 0) data_ptr = nst_fill
2746 where(fice_ptr > 0.0) data_ptr = nst_fill
2750 call esmf_fieldbundledestroy(nst_bundle,rc=rc)
2751 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
2752 call error_handler(
"IN FieldBundleDestroy", rc)
2767 real(esmf_kind_r8),
pointer :: target_ptr(:,:), target_ptr_3d(:,:,:)
2768 real :: init_val = -999.9
2770 print*,
"- CALL FieldCreate FOR TARGET GRID T2M." 2772 typekind=esmf_typekind_r8, &
2773 name=
"t2m_target_grid", &
2774 staggerloc=esmf_staggerloc_center, rc=rc)
2775 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2776 call error_handler(
"IN FieldCreate", rc)
2778 print*,
"- INITIALIZE TARGET grid t2m." 2780 farrayptr=target_ptr, rc=rc)
2781 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2782 call error_handler(
"IN FieldGet", rc)
2784 target_ptr = init_val
2786 print*,
"- CALL FieldCreate FOR TARGET GRID Q2M." 2788 typekind=esmf_typekind_r8, &
2789 name=
"q2m_target_grid", &
2790 staggerloc=esmf_staggerloc_center, rc=rc)
2791 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2792 call error_handler(
"IN FieldCreate", rc)
2794 print*,
"- INITIALIZE TARGET grid q2m." 2796 farrayptr=target_ptr, rc=rc)
2797 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2798 call error_handler(
"IN FieldGet", rc)
2800 target_ptr = init_val
2802 print*,
"- CALL FieldCreate FOR TARGET GRID TPRCP." 2804 typekind=esmf_typekind_r8, &
2805 name=
"tprcp_target_grid", &
2806 staggerloc=esmf_staggerloc_center, rc=rc)
2807 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2808 call error_handler(
"IN FieldCreate", rc)
2810 print*,
"- INITIALIZE TARGET grid tprcp." 2812 farrayptr=target_ptr, rc=rc)
2813 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2814 call error_handler(
"IN FieldGet", rc)
2816 target_ptr = init_val
2818 print*,
"- CALL FieldCreate FOR TARGET GRID F10M." 2820 typekind=esmf_typekind_r8, &
2821 name=
"f10m_target_grid", &
2822 staggerloc=esmf_staggerloc_center, rc=rc)
2823 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2824 call error_handler(
"IN FieldCreate", rc)
2826 print*,
"- INITIALIZE TARGET grid f10m." 2828 farrayptr=target_ptr, rc=rc)
2829 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2830 call error_handler(
"IN FieldGet", rc)
2832 target_ptr = init_val
2834 print*,
"- CALL FieldCreate FOR TARGET GRID FFMM." 2836 typekind=esmf_typekind_r8, &
2837 name=
"ffmm_target_grid", &
2838 staggerloc=esmf_staggerloc_center, rc=rc)
2839 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2840 call error_handler(
"IN FieldCreate", rc)
2842 print*,
"- INITIALIZE TARGET grid ffmm." 2844 farrayptr=target_ptr, rc=rc)
2845 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2846 call error_handler(
"IN FieldGet", rc)
2848 target_ptr = init_val
2850 print*,
"- CALL FieldCreate FOR TARGET GRID USTAR." 2852 typekind=esmf_typekind_r8, &
2853 name=
"ustar_target_grid", &
2854 staggerloc=esmf_staggerloc_center, rc=rc)
2855 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2856 call error_handler(
"IN FieldCreate", rc)
2858 print*,
"- INITIALIZE TARGET grid ustar." 2860 farrayptr=target_ptr, rc=rc)
2861 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2862 call error_handler(
"IN FieldGet", rc)
2864 target_ptr = init_val
2866 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW LIQ EQUIV." 2868 typekind=esmf_typekind_r8, &
2869 name=
"snow_liq_equiv_target_grid", &
2870 staggerloc=esmf_staggerloc_center, rc=rc)
2871 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2872 call error_handler(
"IN FieldCreate", rc)
2874 print*,
"- INITIALIZE TARGET grid snow liq equiv." 2876 farrayptr=target_ptr, rc=rc)
2877 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2878 call error_handler(
"IN FieldGet", rc)
2880 target_ptr = init_val
2882 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW LIQ EQUIV AT SEA ICE." 2884 typekind=esmf_typekind_r8, &
2885 name=
"snow_liq_equiv_at_ice_target_grid", &
2886 staggerloc=esmf_staggerloc_center, rc=rc)
2887 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2888 call error_handler(
"IN FieldCreate", rc)
2890 print*,
"- INITIALIZE TARGET grid snow liq equiv at sea ice." 2892 farrayptr=target_ptr, rc=rc)
2893 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2894 call error_handler(
"IN FieldGet", rc)
2896 target_ptr = init_val
2898 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW DEPTH." 2900 typekind=esmf_typekind_r8, &
2901 name=
"snow_depth_target_grid", &
2902 staggerloc=esmf_staggerloc_center, rc=rc)
2903 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2904 call error_handler(
"IN FieldCreate", rc)
2906 print*,
"- INITIALIZE TARGET grid snow depth." 2908 farrayptr=target_ptr, rc=rc)
2909 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2910 call error_handler(
"IN FieldGet", rc)
2912 target_ptr = init_val
2914 print*,
"- CALL FieldCreate FOR TARGET GRID SNOW DEPTH AT SEA ICE." 2916 typekind=esmf_typekind_r8, &
2917 name=
"snow_depth_at_ice_target_grid", &
2918 staggerloc=esmf_staggerloc_center, rc=rc)
2919 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2920 call error_handler(
"IN FieldCreate", rc)
2922 print*,
"- INITIALIZE TARGET grid snow depth at sea ice." 2924 farrayptr=target_ptr, rc=rc)
2925 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2926 call error_handler(
"IN FieldGet", rc)
2928 target_ptr = init_val
2930 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE FRACTION." 2932 typekind=esmf_typekind_r8, &
2933 name=
"seaice_fract_target_grid", &
2934 staggerloc=esmf_staggerloc_center, rc=rc)
2935 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2936 call error_handler(
"IN FieldCreate", rc)
2938 print*,
"- INITIALIZE TARGET grid sea ice fraction." 2940 farrayptr=target_ptr, rc=rc)
2941 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2942 call error_handler(
"IN FieldGet", rc)
2944 target_ptr = init_val
2946 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE DEPTH." 2948 typekind=esmf_typekind_r8, &
2949 name=
"seaice_depth_target_grid", &
2950 staggerloc=esmf_staggerloc_center, rc=rc)
2951 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2952 call error_handler(
"IN FieldCreate", rc)
2954 print*,
"- INITIALIZE TARGET sea ice depth." 2956 farrayptr=target_ptr, rc=rc)
2957 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2958 call error_handler(
"IN FieldGet", rc)
2960 target_ptr = init_val
2962 print*,
"- CALL FieldCreate FOR TARGET GRID sst." 2964 typekind=esmf_typekind_r8, &
2965 name=
"sst_target_grid", &
2966 staggerloc=esmf_staggerloc_center, rc=rc)
2967 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2968 call error_handler(
"IN FieldCreate", rc)
2970 print*,
"- INITIALIZE TARGET sst." 2972 farrayptr=target_ptr, rc=rc)
2973 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2974 call error_handler(
"IN FieldGet", rc)
2976 target_ptr = init_val
2978 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE SKIN TEMP." 2980 typekind=esmf_typekind_r8, &
2981 name=
"seaice_skin_temp_target_grid", &
2982 staggerloc=esmf_staggerloc_center, rc=rc)
2983 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2984 call error_handler(
"IN FieldCreate", rc)
2986 print*,
"- INITIALIZE TARGET sea ice skin temp." 2988 farrayptr=target_ptr, rc=rc)
2989 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
2990 call error_handler(
"IN FieldGet", rc)
2992 target_ptr = init_val
2994 print*,
"- CALL FieldCreate FOR TARGET GRID SRFLAG." 2996 typekind=esmf_typekind_r8, &
2997 name=
"srflag_target_grid", &
2998 staggerloc=esmf_staggerloc_center, rc=rc)
2999 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3000 call error_handler(
"IN FieldCreate", rc)
3002 print*,
"- INITIALIZE TARGET srflag." 3004 farrayptr=target_ptr, rc=rc)
3005 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3006 call error_handler(
"IN FieldGet", rc)
3008 target_ptr = init_val
3010 print*,
"- CALL FieldCreate FOR TARGET GRID SKIN TEMPERATURE." 3012 typekind=esmf_typekind_r8, &
3013 name=
"skin_temp_target_grid", &
3014 staggerloc=esmf_staggerloc_center, rc=rc)
3015 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3016 call error_handler(
"IN FieldCreate", rc)
3018 print*,
"- INITIALIZE TARGET grid skin temp." 3020 farrayptr=target_ptr, rc=rc)
3021 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3022 call error_handler(
"IN FieldGet", rc)
3024 target_ptr = init_val
3026 print*,
"- CALL FieldCreate FOR TARGET GRID CANOPY MOISTURE CONTENT." 3028 typekind=esmf_typekind_r8, &
3029 name=
"canopy_mc_target_grid", &
3030 staggerloc=esmf_staggerloc_center, rc=rc)
3031 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3032 call error_handler(
"IN FieldCreate", rc)
3034 print*,
"- INITIALIZE TARGET grid canopy moisture." 3036 farrayptr=target_ptr, rc=rc)
3037 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3038 call error_handler(
"IN FieldGet", rc)
3040 target_ptr = init_val
3042 print*,
"- CALL FieldCreate FOR TARGET GRID LEAF AREA INDEX." 3044 typekind=esmf_typekind_r8, &
3045 name=
"lai_target_grid",&
3046 staggerloc=esmf_staggerloc_center, rc=rc)
3047 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3048 call error_handler(
"IN FieldCreate", rc)
3050 print*,
"- INITIALIZE TARGET leaf area index." 3052 farrayptr=target_ptr, rc=rc)
3053 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3054 call error_handler(
"IN FieldGet", rc)
3056 target_ptr = init_val
3058 print*,
"- CALL FieldCreate FOR TARGET GRID Z0_ICE." 3060 typekind=esmf_typekind_r8, &
3061 name=
"z0_ice_target_grid", &
3062 staggerloc=esmf_staggerloc_center, rc=rc)
3063 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3064 call error_handler(
"IN FieldCreate", rc)
3066 print*,
"- INITIALIZE TARGET grid z0_ice." 3068 farrayptr=target_ptr, rc=rc)
3069 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3070 call error_handler(
"IN FieldGet", rc)
3072 target_ptr = init_val
3074 print*,
"- CALL FieldCreate FOR TARGET GRID Z0_WATER." 3076 typekind=esmf_typekind_r8, &
3077 name=
"z0_water_target_grid", &
3078 staggerloc=esmf_staggerloc_center, rc=rc)
3079 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3080 call error_handler(
"IN FieldCreate", rc)
3082 print*,
"- INITIALIZE TARGET grid z0_water." 3084 farrayptr=target_ptr, rc=rc)
3085 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3086 call error_handler(
"IN FieldGet", rc)
3088 target_ptr = init_val
3090 print*,
"- CALL FieldCreate FOR INTERPOLATED TARGET GRID TERRAIN." 3092 typekind=esmf_typekind_r8, &
3093 name=
"terrain_from_input_grid", &
3094 staggerloc=esmf_staggerloc_center, rc=rc)
3095 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3096 call error_handler(
"IN FieldCreate", rc)
3098 print*,
"- INITIALIZE TARGET grid interpolated terrain." 3100 farrayptr=target_ptr, rc=rc)
3101 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3102 call error_handler(
"IN FieldGet", rc)
3104 target_ptr = init_val
3106 print*,
"- CALL FieldCreate FOR INTERPOLATED TARGET GRID SOIL TYPE." 3108 typekind=esmf_typekind_r8, &
3109 staggerloc=esmf_staggerloc_center, &
3110 name=
"soil_type_from_input_grid", rc=rc)
3111 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3112 call error_handler(
"IN FieldCreate", rc)
3114 print*,
"- INITIALIZE TARGET grid soil type" 3116 farrayptr=target_ptr, rc=rc)
3117 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3118 call error_handler(
"IN FieldGet", rc)
3120 target_ptr = init_val
3122 print*,
"- CALL FieldCreate FOR TARGET GRID SEA ICE COLUMN TEMPERATURE." 3124 typekind=esmf_typekind_r8, &
3125 staggerloc=esmf_staggerloc_center, &
3126 name=
"ice_temp_target_grid", &
3127 ungriddedlbound=(/1/), &
3129 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3130 call error_handler(
"IN FieldCreate", rc)
3132 print*,
"- INITIALIZE TARGET grid ice temp" 3134 farrayptr=target_ptr_3d, rc=rc)
3135 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3136 call error_handler(
"IN FieldGet", rc)
3138 target_ptr_3d = init_val
3140 print*,
"- CALL FieldCreate FOR TARGET GRID SOIL TEMPERATURE." 3142 typekind=esmf_typekind_r8, &
3143 staggerloc=esmf_staggerloc_center, &
3144 name=
"soil_temp_target_grid", &
3145 ungriddedlbound=(/1/), &
3147 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3148 call error_handler(
"IN FieldCreate", rc)
3150 print*,
"- INITIALIZE TARGET grid soil temp" 3152 farrayptr=target_ptr_3d, rc=rc)
3153 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3154 call error_handler(
"IN FieldGet", rc)
3156 target_ptr_3d = init_val
3158 print*,
"- CALL FieldCreate FOR TARGET GRID TOTAL SOIL MOISTURE." 3160 typekind=esmf_typekind_r8, &
3161 staggerloc=esmf_staggerloc_center, &
3162 name=
"soilm_tot_target_grid", &
3163 ungriddedlbound=(/1/), &
3165 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3166 call error_handler(
"IN FieldCreate", rc)
3168 print*,
"- INITIALIZE TARGET grid soil moist" 3170 farrayptr=target_ptr_3d, rc=rc)
3171 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3172 call error_handler(
"IN FieldGet", rc)
3174 target_ptr_3d = init_val
3176 print*,
"- CALL FieldCreate FOR TARGET GRID LIQUID SOIL MOISTURE." 3178 typekind=esmf_typekind_r8, &
3179 staggerloc=esmf_staggerloc_center, &
3180 name=
"soilm_liq_target_grid", &
3181 ungriddedlbound=(/1/), &
3183 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3184 call error_handler(
"IN FieldCreate", rc)
3186 print*,
"- INITIALIZE TARGET grid soil liq" 3188 farrayptr=target_ptr_3d, rc=rc)
3189 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3190 call error_handler(
"IN FieldGet", rc)
3192 target_ptr_3d = init_val
3207 print*,
"- CALL FieldCreate FOR TARGET GRID C_D." 3209 typekind=esmf_typekind_r8, &
3211 staggerloc=esmf_staggerloc_center, rc=rc)
3212 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3213 call error_handler(
"IN FieldCreate", rc)
3215 print*,
"- CALL FieldCreate FOR TARGET GRID C_0." 3217 typekind=esmf_typekind_r8, &
3219 staggerloc=esmf_staggerloc_center, rc=rc)
3220 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3221 call error_handler(
"IN FieldCreate", rc)
3223 print*,
"- CALL FieldCreate FOR TARGET GRID D_CONV." 3225 typekind=esmf_typekind_r8, &
3227 staggerloc=esmf_staggerloc_center, rc=rc)
3228 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3229 call error_handler(
"IN FieldCreate", rc)
3231 print*,
"- CALL FieldCreate FOR TARGET GRID DT_COOL." 3233 typekind=esmf_typekind_r8, &
3235 staggerloc=esmf_staggerloc_center, rc=rc)
3236 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3237 call error_handler(
"IN FieldCreate", rc)
3239 print*,
"- CALL FieldCreate FOR TARGET GRID IFD." 3241 typekind=esmf_typekind_r8, &
3243 staggerloc=esmf_staggerloc_center, rc=rc)
3244 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3245 call error_handler(
"IN FieldCreate", rc)
3247 print*,
"- CALL FieldCreate FOR TARGET GRID QRAIN." 3249 typekind=esmf_typekind_r8, &
3251 staggerloc=esmf_staggerloc_center, rc=rc)
3252 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3253 call error_handler(
"IN FieldCreate", rc)
3255 print*,
"- CALL FieldCreate FOR TARGET GRID TREF." 3257 typekind=esmf_typekind_r8, &
3259 staggerloc=esmf_staggerloc_center, rc=rc)
3260 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3261 call error_handler(
"IN FieldCreate", rc)
3263 print*,
"- CALL FieldCreate FOR TARGET GRID W_D." 3265 typekind=esmf_typekind_r8, &
3267 staggerloc=esmf_staggerloc_center, rc=rc)
3268 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3269 call error_handler(
"IN FieldCreate", rc)
3271 print*,
"- CALL FieldCreate FOR TARGET GRID W_0." 3273 typekind=esmf_typekind_r8, &
3275 staggerloc=esmf_staggerloc_center, rc=rc)
3276 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3277 call error_handler(
"IN FieldCreate", rc)
3279 print*,
"- CALL FieldCreate FOR TARGET GRID XS." 3281 typekind=esmf_typekind_r8, &
3283 staggerloc=esmf_staggerloc_center, rc=rc)
3284 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3285 call error_handler(
"IN FieldCreate", rc)
3287 print*,
"- CALL FieldCreate FOR TARGET GRID XT." 3289 typekind=esmf_typekind_r8, &
3291 staggerloc=esmf_staggerloc_center, rc=rc)
3292 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3293 call error_handler(
"IN FieldCreate", rc)
3295 print*,
"- CALL FieldCreate FOR TARGET GRID XU." 3297 typekind=esmf_typekind_r8, &
3299 staggerloc=esmf_staggerloc_center, rc=rc)
3300 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3301 call error_handler(
"IN FieldCreate", rc)
3303 print*,
"- CALL FieldCreate FOR TARGET GRID XV." 3305 typekind=esmf_typekind_r8, &
3307 staggerloc=esmf_staggerloc_center, rc=rc)
3308 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3309 call error_handler(
"IN FieldCreate", rc)
3311 print*,
"- CALL FieldCreate FOR TARGET GRID XZ." 3313 typekind=esmf_typekind_r8, &
3315 staggerloc=esmf_staggerloc_center, rc=rc)
3316 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3317 call error_handler(
"IN FieldCreate", rc)
3319 print*,
"- CALL FieldCreate FOR TARGET GRID XTTS." 3321 typekind=esmf_typekind_r8, &
3323 staggerloc=esmf_staggerloc_center, rc=rc)
3324 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3325 call error_handler(
"IN FieldCreate", rc)
3327 print*,
"- CALL FieldCreate FOR TARGET GRID XZTS." 3329 typekind=esmf_typekind_r8, &
3331 staggerloc=esmf_staggerloc_center, rc=rc)
3332 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3333 call error_handler(
"IN FieldCreate", rc)
3335 print*,
"- CALL FieldCreate FOR TARGET GRID Z_C." 3337 typekind=esmf_typekind_r8, &
3339 staggerloc=esmf_staggerloc_center, rc=rc)
3340 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3341 call error_handler(
"IN FieldCreate", rc)
3343 print*,
"- CALL FieldCreate FOR TARGET GRID ZM." 3345 typekind=esmf_typekind_r8, &
3347 staggerloc=esmf_staggerloc_center, rc=rc)
3348 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3349 call error_handler(
"IN FieldCreate", rc)
3367 integer :: i, j, rc, clb(2), cub(2)
3368 integer(esmf_kind_i8),
pointer :: mask_ptr(:,:)
3370 real(esmf_kind_r8),
pointer :: ice_ptr(:,:)
3371 real(esmf_kind_r8),
pointer :: land_frac_ptr(:,:)
3373 print*,
"- UPDATE TARGET LANDMASK WITH ICE RECORD." 3375 print*,
"- GET TARGET grid sea ice fraction." 3377 farrayptr=ice_ptr, rc=rc)
3378 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3379 call error_handler(
"IN FieldGet", rc)
3381 print*,
"- GET TARGET landmask." 3383 farrayptr=mask_ptr, rc=rc)
3384 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3385 call error_handler(
"IN FieldGet", rc)
3387 print*,
"- GET TARGET land fraction." 3389 computationallbound=clb, &
3390 computationalubound=cub, &
3391 farrayptr=land_frac_ptr, rc=rc)
3392 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3393 call error_handler(
"IN FieldGet", rc)
3395 do j = clb(2), cub(2)
3396 do i = clb(1), cub(1)
3398 mask_ptr(i,j) = ceiling(land_frac_ptr(i,j))
3399 if (mask_ptr(i,j) /= 1)
then 3400 if(ice_ptr(i,j) > 0.0)
then 3420 subroutine ij_to_i_j(ij, itile, jtile, i, j)
3424 integer(esmf_kind_i4),
intent(in) :: ij
3425 integer ,
intent(in) :: itile, jtile
3427 integer ,
intent(out) :: i, j
3430 integer :: pt_loc_this_tile
3432 tile_num = ((ij-1) / (itile*jtile))
3433 pt_loc_this_tile = ij - (tile_num * itile * jtile)
3436 j = (pt_loc_this_tile - 1) / itile + 1
3437 i = mod(pt_loc_this_tile, itile)
3455 subroutine regrid_many(bundle_pre,bundle_post, num_field,route,dozero, &
3456 unmapped_ptr,resetifd)
3464 integer,
intent(in) :: num_field
3465 type(esmf_routehandle),
intent(inout) :: route
3466 type(esmf_fieldbundle),
intent(in) :: bundle_pre, bundle_post
3467 logical,
intent(in) :: dozero(num_field)
3468 logical,
intent(in),
optional :: resetifd
3469 integer(esmf_kind_i4),
intent(inout),
optional :: unmapped_ptr(:)
3471 type(esmf_field) :: field_pre,field_post
3472 real(esmf_kind_r8),
pointer :: tmp_ptr(:,:)
3475 logical :: is2d(num_field)
3476 character(len=50) :: fname
3477 integer :: i, j, k, ij, ind_2d, ind_3d, rc, ndims,n2d, n3d,localpet, l(1), u(1)
3483 if(
present(unmapped_ptr))
then 3484 l = lbound(unmapped_ptr)
3485 u = ubound(unmapped_ptr)
3489 call esmf_fieldbundleget(bundle_pre,i,field_pre,rc=rc)
3490 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3491 call error_handler(
"IN FieldBundleGet", rc)
3493 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3494 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3495 call error_handler(
"IN FieldBundleGet", rc)
3497 call esmf_fieldget(field_post,dimcount=ndims,name=fname,rc=rc)
3498 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3499 call error_handler(
"IN FieldGet", rc)
3501 call esmf_vmgetglobal(vm, rc=rc)
3502 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3503 call error_handler(
"IN VMGetGlobal", rc)
3504 call esmf_vmget(vm, localpet=localpet, rc=rc)
3505 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3506 call error_handler(
"IN VMGet", rc)
3507 if(localpet==0) print*,
"in regrid_many fname = ", fname, ndims
3508 if (ndims == 2) is2d(i) = .true.
3509 if (ndims == 3) is2d(i) = .false.
3512 call esmf_fieldregrid(field_pre, &
3514 routehandle=route, &
3515 termorderflag=esmf_termorder_srcseq, rc=rc)
3516 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3517 call error_handler(
"IN FieldRegrid", rc)
3519 call esmf_fieldregrid(field_pre, &
3521 routehandle=route, &
3522 zeroregion=esmf_region_select, &
3523 termorderflag=esmf_termorder_srcseq, rc=rc)
3524 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3525 call error_handler(
"IN FieldRegrid", rc)
3529 if (
present(resetifd))
then 3532 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3533 call error_handler(
"IN FieldGet", rc)
3534 tmp_ptr = float(nint(tmp_ptr))
3538 n2d = count(is2d(:))
3539 n3d = count(.not.is2d(:))
3540 if(localpet==0) print*, is2d(:)
3541 if (
present(unmapped_ptr))
then 3542 allocate(ptr_2d(n2d))
3543 if (n3d .ne. 0)
allocate(ptr_3d(n3d))
3547 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3548 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3549 call error_handler(
"IN FieldBundleGet", rc)
3550 call esmf_fieldget(field_post, farrayptr=ptr_2d(ind_2d)%p, rc=rc)
3551 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3552 call error_handler(
"IN FieldGet", rc)
3553 call esmf_fieldget(field_post,name=fname,rc=rc)
3554 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3555 call error_handler(
"IN FieldGet", rc)
3556 if (localpet==0) print*,
"in doreplace loop, 2d field = ", trim(fname)
3559 call esmf_fieldbundleget(bundle_post,i,field_post,rc=rc)
3560 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3561 call error_handler(
"IN FieldBundleGet", rc)
3562 call esmf_fieldget(field_post,name=fname,rc=rc)
3563 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3564 call error_handler(
"IN FieldGet", rc)
3565 if (localpet==0) print*,
"in doreplace loop, 3d field = ", trim(fname)
3566 call esmf_fieldget(field_post, farrayptr=ptr_3d(ind_3d)%p, rc=rc)
3567 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__)) &
3568 call error_handler(
"IN FieldGet", rc)
3575 ptr_2d(k)%p(i,j) = -9999.9
3578 ptr_3d(k)%p(i,j,:) = -9999.9
3582 if(n3d .ne. 0)
deallocate(ptr_3d)
3600 subroutine search_many(num_field,bundle_target,tile,search_nums,localpet,latitude, &
3601 terrain_land,soilt_climo, mask)
3609 integer,
intent(in) :: num_field
3610 type(esmf_fieldbundle),
intent(inout) :: bundle_target
3613 real(esmf_kind_r8),
intent(inout),
optional :: terrain_land(
i_target,
j_target)
3614 real(esmf_kind_r8),
intent(inout),
optional :: soilt_climo(
i_target,
j_target)
3617 real(esmf_kind_r8),
allocatable :: field_data_2d(:,:)
3618 real(esmf_kind_r8),
allocatable :: field_data_3d(:,:,:)
3619 integer,
intent(in) :: tile,localpet
3620 integer,
intent(inout) :: search_nums(num_field)
3622 type(esmf_field) :: temp_field
3623 character(len=50) :: fname
3624 integer,
parameter :: sotyp_land_field_num = 224
3625 integer,
parameter :: sst_field_num = 11
3626 integer,
parameter :: terrain_field_num= 7
3627 integer :: j,k, rc, ndims
3631 call esmf_fieldbundleget(bundle_target,k,temp_field, rc=rc)
3632 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3633 call error_handler(
"IN FieldGet", rc)
3634 call esmf_fieldget(temp_field, name=fname, dimcount=ndims,rc=rc)
3635 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3636 call error_handler(
"IN FieldGet", rc)
3637 if (localpet==0)
then 3640 allocate(field_data_2d(0,0))
3642 if (ndims .eq. 2)
then 3643 call esmf_fieldgather(temp_field,field_data_2d,rootpet=0,tile=tile, rc=rc)
3644 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3645 call error_handler(
"IN FieldGather", rc)
3646 if (localpet == 0)
then 3647 if (
present(latitude) .and. search_nums(k).eq.sst_field_num)
then 3650 elseif (
present(terrain_land) .and. search_nums(k) .eq. terrain_field_num)
then 3653 elseif (search_nums(k) .eq. sotyp_land_field_num)
then 3655 if (fname .eq.
"soil_type_target_grid")
then 3659 elseif (
present(soilt_climo))
then 3668 field_data_2d = soilt_climo
3677 call esmf_fieldscatter(temp_field, field_data_2d, rootpet=0, tile=tile,rc=rc)
3678 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3679 call error_handler(
"IN FieldScatter", rc)
3681 if (localpet==0)
then 3684 allocate(field_data_3d(0,0,0))
3688 call esmf_fieldgather(temp_field,field_data_3d,rootpet=0,tile=tile,rc=rc)
3689 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3690 call error_handler(
"IN FieldGather", rc)
3692 if (localpet==0)
then 3694 field_data_2d = field_data_3d(:,:,j)
3696 field_data_3d(:,:,j) = field_data_2d
3699 call esmf_fieldscatter(temp_field, field_data_3d, rootpet=0, tile=tile,rc=rc)
3700 if(esmf_logfounderror(rctocheck=rc,msg=esmf_logerr_passthru,line=__line__,file=__file__))&
3701 call error_handler(
"IN FieldScatter", rc)
3702 deallocate(field_data_3d)
3704 deallocate(field_data_2d)
3721 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.
real function frh2o(TKELV, SMC, SH2O, SMCMAX, BEXP, PSIS)
Calculate supercooled soil moisture.
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