diff --git a/modulefiles/build.hera.gnu.lua b/modulefiles/build.hera.gnu.lua index 331aefe85..3756fd3e0 100644 --- a/modulefiles/build.hera.gnu.lua +++ b/modulefiles/build.hera.gnu.lua @@ -22,7 +22,7 @@ load(pathJoin("hpc-mpich", mpich_ver)) netcdf_ver=os.getenv("netcdf_ver") or "4.7.4" load(pathJoin("netcdf", netcdf_ver)) -esmf_ver=os.getenv("esmf_ver") or "8.2.1b04" +esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) bacio_ver=os.getenv("bacio_ver") or "2.4.1" diff --git a/modulefiles/build.hera.intel.lua b/modulefiles/build.hera.intel.lua index d82571889..6637da08a 100644 --- a/modulefiles/build.hera.intel.lua +++ b/modulefiles/build.hera.intel.lua @@ -58,7 +58,7 @@ load(pathJoin("netcdf", netcdf_ver)) nccmp_ver=os.getenv("nccmp_ver") or "1.8.9.0" load(pathJoin("nccmp", nccmp_ver)) -esmf_ver=os.getenv("esmf_ver") or "8.2.1b04" +esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "4.9.1" diff --git a/modulefiles/build.jet.intel.lua b/modulefiles/build.jet.intel.lua index fbf9d8024..bc716c79d 100644 --- a/modulefiles/build.jet.intel.lua +++ b/modulefiles/build.jet.intel.lua @@ -28,7 +28,7 @@ load(pathJoin("netcdf", netcdf_ver)) nccmp_ver=os.getenv("nccmp_ver") or "1.8.9.0" load(pathJoin("nccmp", nccmp_ver)) -esmf_ver=os.getenv("esmf_ver") or "8.2.0" +esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) w3nco_ver=os.getenv("w3nco_ver") or "2.4.1" diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua index 80e5986d1..b2efc0045 100644 --- a/modulefiles/build.orion.intel.lua +++ b/modulefiles/build.orion.intel.lua @@ -55,7 +55,7 @@ load(pathJoin("netcdf", netcdf_ver)) nccmp_ver=os.getenv("nccmp_ver") or "1.8.9.0" load(pathJoin("nccmp", nccmp_ver)) -esmf_ver=os.getenv("esmf_ver") or "8.2.0" +esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "4.9.3" diff --git a/modulefiles/build.wcoss2.intel.lua b/modulefiles/build.wcoss2.intel.lua index e3869cc8a..7fa476848 100644 --- a/modulefiles/build.wcoss2.intel.lua +++ b/modulefiles/build.wcoss2.intel.lua @@ -73,7 +73,7 @@ load(pathJoin("nco", nco_ver)) setenv("HPC_OPT","/apps/ops/para/libs") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.7") -esmf_ver=os.getenv("esmf_ver") or "8.2.1b04" +esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) whatis("Description: UFS_UTILS build environment") diff --git a/sorc/chgres_cube.fd/atm_input_data.F90 b/sorc/chgres_cube.fd/atm_input_data.F90 index bf5494b72..bcb0e3782 100644 --- a/sorc/chgres_cube.fd/atm_input_data.F90 +++ b/sorc/chgres_cube.fd/atm_input_data.F90 @@ -54,7 +54,9 @@ module atm_input_data type(esmf_field), public :: u_input_grid !< u/v wind at grid type(esmf_field), public :: v_input_grid !< box center - type(esmf_field), public :: wind_input_grid !< 3-component wind + type(esmf_field), public :: xwind_input_grid !< x-component wind + type(esmf_field), public :: ywind_input_grid !< y-component wind + type(esmf_field), public :: zwind_input_grid !< z-component wind type(esmf_field), allocatable, public :: tracers_input_grid(:) !< tracers integer, public :: lev_input !< number of atmospheric layers @@ -64,7 +66,7 @@ module atm_input_data public :: read_input_atm_data public :: cleanup_input_atm_data - public :: convert_winds + public :: convert_winds_to_xyz contains @@ -150,15 +152,6 @@ subroutine init_atm_esmf_fields print*,"- INITIALIZE ATMOSPHERIC ESMF FIELDS." - print*,"- CALL FieldCreate FOR INPUT GRID 3-D WIND." - wind_input_grid = ESMF_FieldCreate(input_grid, & - typekind=ESMF_TYPEKIND_R8, & - staggerloc=ESMF_STAGGERLOC_CENTER, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_input,3/), rc=rc) - if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & - call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR INPUT GRID SURFACE PRESSURE." ps_input_grid = ESMF_FieldCreate(input_grid, & typekind=ESMF_TYPEKIND_R8, & @@ -173,6 +166,33 @@ subroutine init_atm_esmf_fields if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) + print*,"- CALL FieldCreate FOR INPUT GRID xwind." + xwind_input_grid = ESMF_FieldCreate(input_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR INPUT GRID ywind." + ywind_input_grid = ESMF_FieldCreate(input_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR INPUT GRID zwind." + zwind_input_grid = ESMF_FieldCreate(input_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + print*,"- CALL FieldCreate FOR INPUT GRID TEMPERATURE." temp_input_grid = ESMF_FieldCreate(input_grid, & typekind=ESMF_TYPEKIND_R8, & @@ -408,7 +428,7 @@ subroutine read_input_atm_gfs_sigio_file(localpet) ! Convert from 2-d to 3-d component winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute 3-d pressure from 'ak' and 'bk'. @@ -668,7 +688,7 @@ subroutine read_input_atm_gfs_gaussian_nemsio_file(localpet) ! Convert from 2-d to 3-d component winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute 3-d pressure from 'ak' and 'bk'. @@ -933,7 +953,7 @@ subroutine read_input_atm_gaussian_nemsio_file(localpet) ! Convert from 2-d to 3-d component winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute 3-d pressure. Mid-layer and surface pressure are computed @@ -1217,7 +1237,7 @@ subroutine read_input_atm_restart_file(localpet) ! Convert from 2-d to 3-d cartesian winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute pressures @@ -1587,7 +1607,7 @@ subroutine read_input_atm_gaussian_netcdf_file(localpet) ! Convert from 2-d to 3-d cartesian winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute pressure. @@ -1893,7 +1913,7 @@ subroutine read_input_atm_tiled_history_file(localpet) ! Convert from 2-d to 3-d cartesian winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Compute pressure. @@ -2854,7 +2874,7 @@ subroutine read_input_atm_grib2_file(localpet) ! Convert from 2-d to 3-d component winds. !--------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_xyz !--------------------------------------------------------------------------- ! Convert dpdt to dzdt if needed @@ -3089,25 +3109,39 @@ end subroutine read_winds !> Convert winds from 2-d to 3-d components. !! !! @author George Gayno NCEP/EMC - subroutine convert_winds + subroutine convert_winds_to_xyz implicit none - integer :: clb(4), cub(4) + integer :: clb(3), cub(3) integer :: i, j, k, rc real(esmf_kind_r8) :: latrad, lonrad - real(esmf_kind_r8), pointer :: windptr(:,:,:,:) + real(esmf_kind_r8), pointer :: xptr(:,:,:) + real(esmf_kind_r8), pointer :: yptr(:,:,:) + real(esmf_kind_r8), pointer :: zptr(:,:,:) real(esmf_kind_r8), pointer :: uptr(:,:,:) real(esmf_kind_r8), pointer :: vptr(:,:,:) real(esmf_kind_r8), pointer :: latptr(:,:) real(esmf_kind_r8), pointer :: lonptr(:,:) - print*,"- CALL FieldGet FOR 3-D WIND." - call ESMF_FieldGet(wind_input_grid, & + print*,"- CALL FieldGet FOR xwind." + call ESMF_FieldGet(xwind_input_grid, & computationalLBound=clb, & computationalUBound=cub, & - farrayPtr=windptr, rc=rc) + farrayPtr=xptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR ywind." + call ESMF_FieldGet(ywind_input_grid, & + farrayPtr=yptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR zwind." + call ESMF_FieldGet(zwind_input_grid, & + farrayPtr=zptr, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) @@ -3140,9 +3174,9 @@ subroutine convert_winds latrad = latptr(i,j) * acos(-1.) / 180.0 lonrad = lonptr(i,j) * acos(-1.) / 180.0 do k = clb(3), cub(3) - windptr(i,j,k,1) = uptr(i,j,k) * cos(lonrad) - vptr(i,j,k) * sin(latrad) * sin(lonrad) - windptr(i,j,k,2) = uptr(i,j,k) * sin(lonrad) + vptr(i,j,k) * sin(latrad) * cos(lonrad) - windptr(i,j,k,3) = vptr(i,j,k) * cos(latrad) + xptr(i,j,k) = uptr(i,j,k) * cos(lonrad) - vptr(i,j,k) * sin(latrad) * sin(lonrad) + yptr(i,j,k) = uptr(i,j,k) * sin(lonrad) + vptr(i,j,k) * sin(latrad) * cos(lonrad) + zptr(i,j,k) = vptr(i,j,k) * cos(latrad) enddo enddo enddo @@ -3150,7 +3184,7 @@ subroutine convert_winds call ESMF_FieldDestroy(u_input_grid, rc=rc) call ESMF_FieldDestroy(v_input_grid, rc=rc) - end subroutine convert_winds + end subroutine convert_winds_to_xyz !> Compute grid rotation angle for non-latlon grids. !! @@ -3257,7 +3291,9 @@ subroutine cleanup_input_atm_data call ESMF_FieldDestroy(pres_input_grid, rc=rc) call ESMF_FieldDestroy(dzdt_input_grid, rc=rc) call ESMF_FieldDestroy(temp_input_grid, rc=rc) - call ESMF_FieldDestroy(wind_input_grid, rc=rc) + call ESMF_FieldDestroy(xwind_input_grid, rc=rc) + call ESMF_FieldDestroy(ywind_input_grid, rc=rc) + call ESMF_FieldDestroy(zwind_input_grid, rc=rc) call ESMF_FieldDestroy(ps_input_grid, rc=rc) do n = 1, num_tracers_input diff --git a/sorc/chgres_cube.fd/atmosphere.F90 b/sorc/chgres_cube.fd/atmosphere.F90 index 46be52c90..b5fd465dc 100644 --- a/sorc/chgres_cube.fd/atmosphere.F90 +++ b/sorc/chgres_cube.fd/atmosphere.F90 @@ -34,7 +34,9 @@ module atmosphere tracers_input_grid, & dzdt_input_grid, & ps_input_grid, & - wind_input_grid, & + xwind_input_grid, & + ywind_input_grid, & + zwind_input_grid, & temp_input_grid, & pres_input_grid, & terrain_input_grid, & @@ -70,6 +72,7 @@ module atmosphere write_fv3_atm_data_netcdf use utilities, only : error_handler + implicit none private @@ -81,10 +84,18 @@ module atmosphere type(esmf_field) :: pres_b4adj_target_grid !< 3-d pres before terrain adj type(esmf_field) :: temp_b4adj_target_grid !< temp before vert adj type(esmf_field) :: terrain_interp_to_target_grid !< Input grid terrain interpolated to target grid. - type(esmf_field) :: wind_target_grid !< 3-d wind, grid box center - type(esmf_field) :: wind_b4adj_target_grid !< 3-d wind before vert adj - type(esmf_field) :: wind_s_target_grid !< 3-d wind, 'south' edge - type(esmf_field) :: wind_w_target_grid !< 3-d wind, 'west' edge + type(esmf_field) :: xwind_target_grid !< x-component wind, grid box center + type(esmf_field) :: ywind_target_grid !< y-component wind, grid box center + type(esmf_field) :: zwind_target_grid !< z-component wind, grid box center + type(esmf_field) :: xwind_b4adj_target_grid !< x-component wind, before vert adj + type(esmf_field) :: ywind_b4adj_target_grid !< y-component wind, before vert adj + type(esmf_field) :: zwind_b4adj_target_grid !< z-component wind, before vert adj + type(esmf_field) :: xwind_s_target_grid !< x-component wind, 'south' edge + type(esmf_field) :: ywind_s_target_grid !< y-component wind, 'south' edge + type(esmf_field) :: zwind_s_target_grid !< z-component wind, 'south' edge + type(esmf_field) :: xwind_w_target_grid !< x-component wind, 'west' edge + type(esmf_field) :: ywind_w_target_grid !< y-component wind, 'west' edge + type(esmf_field) :: zwind_w_target_grid !< z-component wind, 'west' edge ! Fields associated with thompson microphysics climatological tracers. @@ -276,14 +287,32 @@ subroutine atmosphere_driver(localpet) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldRegrid", rc) - print*,"- CALL Field_Regrid FOR 3-D WIND." - call ESMF_FieldRegrid(wind_input_grid, & - wind_b4adj_target_grid, & + print*,"- CALL Field_Regrid FOR x WIND." + call ESMF_FieldRegrid(xwind_input_grid, & + xwind_b4adj_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR y WIND." + call ESMF_FieldRegrid(ywind_input_grid, & + ywind_b4adj_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR z WIND." + call ESMF_FieldRegrid(zwind_input_grid, & + zwind_b4adj_target_grid, & routehandle=regrid_bl, & termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldRegrid", rc) + + print*,"- CALL FieldRegridRelease." call ESMF_FieldRegridRelease(routehandle=regrid_bl, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & @@ -342,9 +371,9 @@ subroutine atmosphere_driver(localpet) isrctermprocessing = 1 method=ESMF_REGRIDMETHOD_BILINEAR - print*,"- CALL FieldRegridStore FOR 3D-WIND WEST EDGE." - call ESMF_FieldRegridStore(wind_target_grid, & - wind_w_target_grid, & + print*,"- CALL FieldRegridStore FOR X-WIND WEST EDGE." + call ESMF_FieldRegridStore(xwind_target_grid, & + xwind_w_target_grid, & polemethod=ESMF_POLEMETHOD_ALLAVG, & srctermprocessing=isrctermprocessing, & routehandle=regrid_bl, & @@ -353,9 +382,25 @@ subroutine atmosphere_driver(localpet) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldRegridStore", rc) - print*,"- CALL Field_Regrid FOR 3-D WIND WEST EDGE." - call ESMF_FieldRegrid(wind_target_grid, & - wind_w_target_grid, & + print*,"- CALL Field_Regrid FOR X-WIND WEST EDGE." + call ESMF_FieldRegrid(xwind_target_grid, & + xwind_w_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR Y-WIND WEST EDGE." + call ESMF_FieldRegrid(ywind_target_grid, & + ywind_w_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR Z-WIND WEST EDGE." + call ESMF_FieldRegrid(zwind_target_grid, & + zwind_w_target_grid, & routehandle=regrid_bl, & termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & @@ -369,9 +414,9 @@ subroutine atmosphere_driver(localpet) isrctermprocessing = 1 method=ESMF_REGRIDMETHOD_BILINEAR - print*,"- CALL FieldRegridStore FOR 3D-WIND SOUTH EDGE." - call ESMF_FieldRegridStore(wind_target_grid, & - wind_s_target_grid, & + print*,"- CALL FieldRegridStore FOR X-WIND SOUTH EDGE." + call ESMF_FieldRegridStore(xwind_target_grid, & + xwind_s_target_grid, & polemethod=ESMF_POLEMETHOD_ALLAVG, & srctermprocessing=isrctermprocessing, & routehandle=regrid_bl, & @@ -380,9 +425,25 @@ subroutine atmosphere_driver(localpet) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldRegridStore", rc) - print*,"- CALL Field_Regrid FOR 3-D WIND SOUTH EDGE." - call ESMF_FieldRegrid(wind_target_grid, & - wind_s_target_grid, & + print*,"- CALL Field_Regrid FOR X-WIND SOUTH EDGE." + call ESMF_FieldRegrid(xwind_target_grid, & + xwind_s_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR Y-WIND SOUTH EDGE." + call ESMF_FieldRegrid(ywind_target_grid, & + ywind_s_target_grid, & + routehandle=regrid_bl, & + termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldRegrid", rc) + + print*,"- CALL Field_Regrid FOR Z-WIND SOUTH EDGE." + call ESMF_FieldRegrid(zwind_target_grid, & + zwind_s_target_grid, & routehandle=regrid_bl, & termorderflag=ESMF_TERMORDER_SRCSEQ, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & @@ -397,7 +458,7 @@ subroutine atmosphere_driver(localpet) ! Convert from 3-d to 2-d cartesian winds. !----------------------------------------------------------------------------------- - call convert_winds + call convert_winds_to_uv !----------------------------------------------------------------------------------- ! If selected, process thompson microphysics climatological fields. @@ -476,12 +537,30 @@ subroutine create_atm_b4adj_esmf_fields if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR TARGET GRID UNSTAGGERED WINDS BEFORE ADJUSTMENT." - wind_b4adj_target_grid = ESMF_FieldCreate(target_grid, & + print*,"- CALL FieldCreate FOR TARGET GRID xwind." + xwind_b4adj_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET GRID ywind." + ywind_b4adj_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET GRID zwind." + zwind_b4adj_target_grid = ESMF_FieldCreate(target_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_CENTER, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_input,3/), rc=rc) + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) @@ -559,21 +638,39 @@ subroutine create_atm_esmf_fields if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR TARGET HEIGHT." - zh_target_grid = ESMF_FieldCreate(target_grid, & + print*,"- CALL FieldCreate FOR TARGET GRID xwind." + xwind_target_grid = ESMF_FieldCreate(target_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_CENTER, & ungriddedLBound=(/1/), & - ungriddedUBound=(/levp1_target/), rc=rc) + ungriddedUBound=(/lev_target/), rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR TARGET UNSTAGGERED 3D-WIND." - wind_target_grid = ESMF_FieldCreate(target_grid, & + print*,"- CALL FieldCreate FOR TARGET GRID ywind." + ywind_target_grid = ESMF_FieldCreate(target_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_CENTER, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_target,3/), rc=rc) + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET GRID zwind." + zwind_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET HEIGHT." + zh_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/levp1_target/), rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) @@ -595,12 +692,30 @@ subroutine create_atm_esmf_fields if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR TARGET 3D-WIND_S." - wind_s_target_grid = ESMF_FieldCreate(target_grid, & + print*,"- CALL FieldCreate FOR TARGET xwind_S." + xwind_s_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_EDGE2, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET ywind_S." + ywind_s_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_EDGE2, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET zwind_S." + zwind_s_target_grid = ESMF_FieldCreate(target_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_EDGE2, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_target,3/), rc=rc) + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) @@ -622,12 +737,30 @@ subroutine create_atm_esmf_fields if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) - print*,"- CALL FieldCreate FOR TARGET 3D-WIND_W." - wind_w_target_grid = ESMF_FieldCreate(target_grid, & + print*,"- CALL FieldCreate FOR TARGET xwind_W." + xwind_w_target_grid = ESMF_FieldCreate(target_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_EDGE1, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_target,3/), rc=rc) + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET ywind_W." + ywind_w_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_EDGE1, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldCreate", rc) + + print*,"- CALL FieldCreate FOR TARGET zwind_W." + zwind_w_target_grid = ESMF_FieldCreate(target_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_EDGE1, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_target/), rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldCreate", rc) @@ -643,18 +776,20 @@ end subroutine create_atm_esmf_fields !> Convert 3-d component winds to u and v. !! !! @author George Gayno - subroutine convert_winds + subroutine convert_winds_to_uv implicit none - integer :: clb(4), cub(4) + integer :: clb(3), cub(3) integer :: i, j, k, rc real(esmf_kind_r8), pointer :: latptr(:,:) real(esmf_kind_r8), pointer :: lonptr(:,:) real(esmf_kind_r8), pointer :: uptr(:,:,:) real(esmf_kind_r8), pointer :: vptr(:,:,:) - real(esmf_kind_r8), pointer :: windptr(:,:,:,:) + real(esmf_kind_r8), pointer :: xwindptr(:,:,:) + real(esmf_kind_r8), pointer :: ywindptr(:,:,:) + real(esmf_kind_r8), pointer :: zwindptr(:,:,:) real(esmf_kind_r8) :: latrad, lonrad !----------------------------------------------------------------------------------- @@ -663,11 +798,23 @@ subroutine convert_winds print*,'- CONVERT WINDS.' - print*,"- CALL FieldGet FOR 3-D WIND_S." - call ESMF_FieldGet(wind_s_target_grid, & + print*,"- CALL FieldGet FOR xwind_S." + call ESMF_FieldGet(xwind_s_target_grid, & computationalLBound=clb, & computationalUBound=cub, & - farrayPtr=windptr, rc=rc) + farrayPtr=xwindptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR ywind_S." + call ESMF_FieldGet(ywind_s_target_grid, & + farrayPtr=ywindptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR zwind_S." + call ESMF_FieldGet(zwind_s_target_grid, & + farrayPtr=zwindptr, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) @@ -700,20 +847,31 @@ subroutine convert_winds latrad = latptr(i,j) * acos(-1.) / 180.0 lonrad = lonptr(i,j) * acos(-1.) / 180.0 do k = clb(3), cub(3) - uptr(i,j,k) = windptr(i,j,k,1) * cos(lonrad) + windptr(i,j,k,2) * sin(lonrad) - vptr(i,j,k) = -windptr(i,j,k,1) * sin(latrad) * sin(lonrad) + & - windptr(i,j,k,2) * sin(latrad) * cos(lonrad) + & - windptr(i,j,k,3) * cos(latrad) + uptr(i,j,k) = xwindptr(i,j,k) * cos(lonrad) + ywindptr(i,j,k) * sin(lonrad) + vptr(i,j,k) = -xwindptr(i,j,k) * sin(latrad) * sin(lonrad) + & + ywindptr(i,j,k) * sin(latrad) * cos(lonrad) + & + zwindptr(i,j,k) * cos(latrad) enddo enddo enddo - - print*,"- CALL FieldGet FOR 3-D WIND_W." - call ESMF_FieldGet(wind_w_target_grid, & + print*,"- CALL FieldGet FOR xwind_w." + call ESMF_FieldGet(xwind_w_target_grid, & computationalLBound=clb, & computationalUBound=cub, & - farrayPtr=windptr, rc=rc) + farrayPtr=xwindptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR ywind_w." + call ESMF_FieldGet(ywind_w_target_grid, & + farrayPtr=ywindptr, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR zwind_w." + call ESMF_FieldGet(zwind_w_target_grid, & + farrayPtr=zwindptr, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) @@ -746,15 +904,15 @@ subroutine convert_winds latrad = latptr(i,j) * acos(-1.) / 180.0 lonrad = lonptr(i,j) * acos(-1.) / 180.0 do k = clb(3), cub(3) - uptr(i,j,k) = windptr(i,j,k,1) * cos(lonrad) + windptr(i,j,k,2) * sin(lonrad) - vptr(i,j,k) = -windptr(i,j,k,1) * sin(latrad) * sin(lonrad) + & - windptr(i,j,k,2) * sin(latrad) * cos(lonrad) + & - windptr(i,j,k,3) * cos(latrad) + uptr(i,j,k) = xwindptr(i,j,k) * cos(lonrad) + ywindptr(i,j,k) * sin(lonrad) + vptr(i,j,k) = -xwindptr(i,j,k) * sin(latrad) * sin(lonrad) + & + ywindptr(i,j,k) * sin(latrad) * cos(lonrad) + & + zwindptr(i,j,k) * cos(latrad) enddo enddo enddo - end subroutine convert_winds + end subroutine convert_winds_to_uv !> Computes 3-D pressure given an adjusted surface pressure. !! @@ -1394,7 +1552,9 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR) REAL(ESMF_KIND_R8), POINTER :: QOPTR(:,:,:) ! output tracer REAL(ESMF_KIND_R8), POINTER :: O2PTR(:,:,:) ! output tracer REAL(ESMF_KIND_R8), POINTER :: O3PTR(:,:,:) ! output tracer - REAL(ESMF_KIND_R8), POINTER :: WIND2PTR(:,:,:,:) ! output wind (x,y,z components) + REAL(ESMF_KIND_R8), POINTER :: XWIND2PTR(:,:,:) ! output wind (x component) + REAL(ESMF_KIND_R8), POINTER :: YWIND2PTR(:,:,:) ! output wind (y component) + REAL(ESMF_KIND_R8), POINTER :: ZWIND2PTR(:,:,:) ! output wind (z component) ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1464,9 +1624,20 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR) call error_handler("IN FieldGet", rc) ! wind - print*,"VINTG_WAM:- CALL FieldGet FOR 3-D ADJUSTED WIND." - call ESMF_FieldGet(wind_target_grid, & - farrayPtr=WIND2PTR, rc=rc) + print*,"VINTG_WAM:- CALL FieldGet FOR ADJUSTED WIND COMPONENTS." + + call ESMF_FieldGet(xwind_target_grid, & + farrayPtr=XWIND2PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + call ESMF_FieldGet(ywind_target_grid, & + farrayPtr=YWIND2PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + call ESMF_FieldGet(zwind_target_grid, & + farrayPtr=ZWIND2PTR, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) @@ -1487,9 +1658,9 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR) ! DO K=KREF,LEV_TARGET COE = P2PTR(I,J,K) / P2PTR(I,J,KREF) - WIND2PTR(I,J,K,1) = COE*WIND2PTR(I,J,K,1) - WIND2PTR(I,J,K,2) = COE*WIND2PTR(I,J,K,2) - WIND2PTR(I,J,K,3) = COE*WIND2PTR(I,J,K,3) + XWIND2PTR(I,J,K) = COE*XWIND2PTR(I,J,K) + YWIND2PTR(I,J,K) = COE*YWIND2PTR(I,J,K) + ZWIND2PTR(I,J,K) = COE*ZWIND2PTR(I,J,K) DZDT2PTR(I,J,K) = COE*DZDT2PTR(I,J,K) ENDDO @@ -1615,8 +1786,12 @@ SUBROUTINE VINTG REAL(ESMF_KIND_R8), POINTER :: T2PTR(:,:,:) ! output temperature REAL(ESMF_KIND_R8), POINTER :: Q1PTR(:,:,:) ! input tracer REAL(ESMF_KIND_R8), POINTER :: Q2PTR(:,:,:) ! output tracer - REAL(ESMF_KIND_R8), POINTER :: WIND1PTR(:,:,:,:) ! input wind (x,y,z components) - REAL(ESMF_KIND_R8), POINTER :: WIND2PTR(:,:,:,:) ! input wind (x,y,z components) + REAL(ESMF_KIND_R8), POINTER :: XWIND1PTR(:,:,:) ! input wind (x component) + REAL(ESMF_KIND_R8), POINTER :: YWIND1PTR(:,:,:) ! input wind (y component) + REAL(ESMF_KIND_R8), POINTER :: ZWIND1PTR(:,:,:) ! input wind (z component) + REAL(ESMF_KIND_R8), POINTER :: XWIND2PTR(:,:,:) ! output wind (x component) + REAL(ESMF_KIND_R8), POINTER :: YWIND2PTR(:,:,:) ! output wind (y component) + REAL(ESMF_KIND_R8), POINTER :: ZWIND2PTR(:,:,:) ! output wind (z component) ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! COMPUTE LOG PRESSURE INTERPOLATING COORDINATE @@ -1653,17 +1828,31 @@ SUBROUTINE VINTG call error_handler("IN FieldGet", rc) Z2 = -LOG(P2PTR) + + print*,"- CALL FieldGet FOR x WIND." + call ESMF_FieldGet(xwind_b4adj_target_grid, & + farrayPtr=XWIND1PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + C1(:,:,:,1) = XWIND1PTR(:,:,:) - print*,"- CALL FieldGet FOR 3-D WIND." - call ESMF_FieldGet(wind_b4adj_target_grid, & - farrayPtr=WIND1PTR, rc=rc) + print*,"- CALL FieldGet FOR y WIND." + call ESMF_FieldGet(ywind_b4adj_target_grid, & + farrayPtr=YWIND1PTR, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) - C1(:,:,:,1) = WIND1PTR(:,:,:,1) - C1(:,:,:,2) = WIND1PTR(:,:,:,2) - C1(:,:,:,3) = WIND1PTR(:,:,:,3) - + C1(:,:,:,2) = YWIND1PTR(:,:,:) + + print*,"- CALL FieldGet FOR z WIND." + call ESMF_FieldGet(zwind_b4adj_target_grid, & + farrayPtr=ZWIND1PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + C1(:,:,:,3) = ZWIND1PTR(:,:,:) + print*,"- CALL FieldGet FOR VERTICAL VELOCITY." call ESMF_FieldGet(dzdt_b4adj_target_grid, & farrayPtr=DZDT1PTR, rc=rc) @@ -1724,18 +1913,30 @@ SUBROUTINE VINTG if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) - print*,"- CALL FieldGet FOR 3-D ADJUSTED WIND." - call ESMF_FieldGet(wind_target_grid, & - farrayPtr=WIND2PTR, rc=rc) + print*,"- CALL FieldGet FOR ADJUSTED xwind." + call ESMF_FieldGet(xwind_target_grid, & + farrayPtr=XWIND2PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR ADJUSTED ywind." + call ESMF_FieldGet(ywind_target_grid, & + farrayPtr=YWIND2PTR, rc=rc) + if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & + call error_handler("IN FieldGet", rc) + + print*,"- CALL FieldGet FOR ADJUSTED zwind." + call ESMF_FieldGet(zwind_target_grid, & + farrayPtr=ZWIND2PTR, rc=rc) if(ESMF_logFoundError(rcToCheck=rc,msg=ESMF_LOGERR_PASSTHRU,line=__LINE__,file=__FILE__)) & call error_handler("IN FieldGet", rc) DO K=1,LEV_TARGET DO I=CLB(1),CUB(1) DO J=CLB(2),CUB(2) - WIND2PTR(I,J,K,1)=C2(I,J,K,1) - WIND2PTR(I,J,K,2)=C2(I,J,K,2) - WIND2PTR(I,J,K,3)=C2(I,J,K,3) + XWIND2PTR(I,J,K)=C2(I,J,K,1) + YWIND2PTR(I,J,K)=C2(I,J,K,2) + ZWIND2PTR(I,J,K)=C2(I,J,K,3) DZDT2PTR(I,J,K)=C2(I,J,K,4) DZ=Z2(I,J,K)-Z1(I,J,1) IF(DZ.GE.0) THEN @@ -2164,7 +2365,9 @@ subroutine cleanup_target_atm_b4adj_data print*,"- DESTROY TARGET GRID ATMOSPHERIC BEFORE ADJUSTMENT FIELDS." - call ESMF_FieldDestroy(wind_b4adj_target_grid, rc=rc) + call ESMF_FieldDestroy(xwind_b4adj_target_grid, rc=rc) + call ESMF_FieldDestroy(ywind_b4adj_target_grid, rc=rc) + call ESMF_FieldDestroy(zwind_b4adj_target_grid, rc=rc) call ESMF_FieldDestroy(dzdt_b4adj_target_grid, rc=rc) call ESMF_FieldDestroy(ps_b4adj_target_grid, rc=rc) call ESMF_FieldDestroy(pres_b4adj_target_grid, rc=rc) @@ -2191,10 +2394,16 @@ subroutine cleanup_all_target_atm_data print*,"- DESTROY LOCAL TARGET GRID ATMOSPHERIC FIELDS." - call ESMF_FieldDestroy(wind_target_grid, rc=rc) - call ESMF_FieldDestroy(wind_s_target_grid, rc=rc) - call ESMF_FieldDestroy(wind_w_target_grid, rc=rc) call ESMF_FieldDestroy(pres_target_grid, rc=rc) + call ESMF_FieldDestroy(xwind_target_grid, rc=rc) + call ESMF_FieldDestroy(ywind_target_grid, rc=rc) + call ESMF_FieldDestroy(zwind_target_grid, rc=rc) + call ESMF_FieldDestroy(xwind_s_target_grid, rc=rc) + call ESMF_FieldDestroy(ywind_s_target_grid, rc=rc) + call ESMF_FieldDestroy(zwind_s_target_grid, rc=rc) + call ESMF_FieldDestroy(xwind_w_target_grid, rc=rc) + call ESMF_FieldDestroy(ywind_w_target_grid, rc=rc) + call ESMF_FieldDestroy(zwind_w_target_grid, rc=rc) call cleanup_atmosphere_target_data diff --git a/tests/chgres_cube/ftst_convert_winds.F90 b/tests/chgres_cube/ftst_convert_winds.F90 index dd675c58c..1af237570 100644 --- a/tests/chgres_cube/ftst_convert_winds.F90 +++ b/tests/chgres_cube/ftst_convert_winds.F90 @@ -14,8 +14,10 @@ program winds latitude_input_grid, & longitude_input_grid - use atm_input_data, only : lev_input, convert_winds, & - wind_input_grid, & + use atm_input_data, only : lev_input, convert_winds_to_xyz, & + xwind_input_grid, & + ywind_input_grid, & + zwind_input_grid, & u_input_grid, & v_input_grid @@ -26,7 +28,7 @@ program winds real, parameter :: EPSILON=0.0001 - integer :: clb(4), cub(4) + integer :: clb(3), cub(3) integer :: ierr, localpet, npets, rc integer :: i, j, k @@ -34,7 +36,9 @@ program winds real(esmf_kind_r8), allocatable :: longitude(:,:) real(esmf_kind_r8), allocatable :: u_wind(:,:,:) real(esmf_kind_r8), allocatable :: v_wind(:,:,:) - real(esmf_kind_r8), pointer :: windptr(:,:,:,:) + real(esmf_kind_r8), pointer :: xwindptr(:,:,:) + real(esmf_kind_r8), pointer :: ywindptr(:,:,:) + real(esmf_kind_r8), pointer :: zwindptr(:,:,:) real :: expected_x_component(IPTS,JPTS) real :: expected_y_component(IPTS,JPTS) @@ -95,11 +99,23 @@ program winds name="input_grid_longitude", & rc=rc) - wind_input_grid = ESMF_FieldCreate(input_grid, & + xwind_input_grid = ESMF_FieldCreate(input_grid, & typekind=ESMF_TYPEKIND_R8, & staggerloc=ESMF_STAGGERLOC_CENTER, & - ungriddedLBound=(/1,1/), & - ungriddedUBound=(/lev_input,3/), rc=rc) + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + + ywind_input_grid = ESMF_FieldCreate(input_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) + + zwind_input_grid = ESMF_FieldCreate(input_grid, & + typekind=ESMF_TYPEKIND_R8, & + staggerloc=ESMF_STAGGERLOC_CENTER, & + ungriddedLBound=(/1/), & + ungriddedUBound=(/lev_input/), rc=rc) u_input_grid = ESMF_FieldCreate(input_grid, & typekind=ESMF_TYPEKIND_R8, & @@ -210,21 +226,31 @@ program winds ! Call the routine to unit test. - call convert_winds + call convert_winds_to_xyz + + call ESMF_FieldGet(xwind_input_grid, & + computationalLBound=clb, & + computationalUBound=cub, & + farrayPtr=xwindptr, rc=rc) + + call ESMF_FieldGet(ywind_input_grid, & + computationalLBound=clb, & + computationalUBound=cub, & + farrayPtr=ywindptr, rc=rc) - call ESMF_FieldGet(wind_input_grid, & + call ESMF_FieldGet(zwind_input_grid, & computationalLBound=clb, & computationalUBound=cub, & - farrayPtr=windptr, rc=rc) + farrayPtr=zwindptr, rc=rc) print*,"Check results." do j = clb(2), cub(2) do i = clb(1), cub(1) do k = clb(3), cub(3) - if (abs(windptr(i,j,k,1) - expected_x_component(i,j)) > EPSILON) stop 2 - if (abs(windptr(i,j,k,2) - expected_y_component(i,j)) > EPSILON) stop 3 - if (abs(windptr(i,j,k,3) - expected_z_component(i,j)) > EPSILON) stop 4 + if (abs(xwindptr(i,j,k) - expected_x_component(i,j)) > EPSILON) stop 2 + if (abs(ywindptr(i,j,k) - expected_y_component(i,j)) > EPSILON) stop 3 + if (abs(zwindptr(i,j,k) - expected_z_component(i,j)) > EPSILON) stop 4 enddo enddo enddo diff --git a/tests/chgres_cube/ftst_read_atm_gaussian_netcdf.F90 b/tests/chgres_cube/ftst_read_atm_gaussian_netcdf.F90 index 95300c988..755bf7b0b 100644 --- a/tests/chgres_cube/ftst_read_atm_gaussian_netcdf.F90 +++ b/tests/chgres_cube/ftst_read_atm_gaussian_netcdf.F90 @@ -26,7 +26,9 @@ program read_atm_gaussian_netcdf dzdt_input_grid, & ps_input_grid, & pres_input_grid, & - wind_input_grid, & + xwind_input_grid, & + ywind_input_grid, & + zwind_input_grid, & terrain_input_grid, & tracers_input_grid @@ -67,7 +69,6 @@ program read_atm_gaussian_netcdf real(esmf_kind_r8), allocatable :: data_one_tile(:,:) real(esmf_kind_r8), allocatable :: data3d_one_tile(:,:,:) - real(esmf_kind_r8), allocatable :: data4d_one_tile(:,:,:,:) real(esmf_kind_r8), allocatable :: latitude(:,:) real(esmf_kind_r8), allocatable :: longitude(:,:) @@ -151,7 +152,6 @@ program read_atm_gaussian_netcdf if (lev_input /= EXPECTED_LEV_INPUT) stop 2 if (levp1_input /= EXPECTED_LEVP1_INPUT) stop 3 - allocate(data4d_one_tile(i_input,j_input,lev_input,3)) allocate(data3d_one_tile(i_input,j_input,lev_input)) allocate(data_one_tile(i_input,j_input)) @@ -187,13 +187,15 @@ program read_atm_gaussian_netcdf if (abs(data3d_one_tile(1,1,1) - expected_values_pres(1)) > EPSILON) stop 18 if (abs(data3d_one_tile(i_input,j_input,lev_input) - expected_values_pres(2)) > EPSILON) stop 19 - call ESMF_FieldGather(wind_input_grid, data4d_one_tile, rootPet=0, rc=rc) - if (abs(data4d_one_tile(1,1,1,1) - expected_values_xwind(1)) > EPSILON) stop 20 - if (abs(data4d_one_tile(1,1,lev_input,1) - expected_values_xwind(2)) > EPSILON) stop 21 - if (abs(data4d_one_tile(1,1,1,2) - expected_values_ywind(1)) > EPSILON) stop 22 - if (abs(data4d_one_tile(1,1,lev_input,2) - expected_values_ywind(2)) > EPSILON) stop 23 - if (abs(data4d_one_tile(1,1,1,3) - expected_values_zwind(1)) > EPSILON) stop 24 - if (abs(data4d_one_tile(1,1,lev_input,3) - expected_values_zwind(2)) > EPSILON) stop 25 + call ESMF_FieldGather(xwind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(1,1,1) - expected_values_xwind(1)) > EPSILON) stop 20 + if (abs(data3d_one_tile(1,1,lev_input) - expected_values_xwind(2)) > EPSILON) stop 21 + call ESMF_FieldGather(ywind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(1,1,1) - expected_values_ywind(1)) > EPSILON) stop 22 + if (abs(data3d_one_tile(1,1,lev_input) - expected_values_ywind(2)) > EPSILON) stop 23 + call ESMF_FieldGather(zwind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(1,1,1) - expected_values_zwind(1)) > EPSILON) stop 24 + if (abs(data3d_one_tile(1,1,lev_input) - expected_values_zwind(2)) > EPSILON) stop 25 call ESMF_FieldGather(terrain_input_grid, data_one_tile, rootPet=0, rc=rc) if (abs(data_one_tile(1,1) - expected_values_terrain(1)) > EPSILON) stop 26 @@ -201,7 +203,7 @@ program read_atm_gaussian_netcdf print*,"OK" - deallocate(latitude, longitude, data4d_one_tile, data3d_one_tile, data_one_tile) + deallocate(latitude, longitude, data3d_one_tile, data_one_tile) call ESMF_finalize(endflag=ESMF_END_KEEPMPI) diff --git a/tests/chgres_cube/ftst_read_atm_grib2.F90 b/tests/chgres_cube/ftst_read_atm_grib2.F90 index 907180cb9..7d19ffeb9 100644 --- a/tests/chgres_cube/ftst_read_atm_grib2.F90 +++ b/tests/chgres_cube/ftst_read_atm_grib2.F90 @@ -16,7 +16,8 @@ program read_atm_grib2 levp1_input, & temp_input_grid, tracers_input_grid, & dzdt_input_grid, pres_input_grid, & - ps_input_grid, wind_input_grid, & + ps_input_grid, xwind_input_grid, & + ywind_input_grid, zwind_input_grid, & terrain_input_grid use program_setup, only : input_type, data_dir_input_grid, & @@ -52,7 +53,6 @@ program read_atm_grib2 real(esmf_kind_r8), allocatable :: longitude(:,:) real(esmf_kind_r8), allocatable :: data_one_tile(:,:) real(esmf_kind_r8), allocatable :: data3d_one_tile(:,:,:) - real(esmf_kind_r8), allocatable :: data4d_one_tile(:,:,:,:) real :: expected_values_tmp(NUM_VALUES) real :: expected_values_sphum(NUM_VALUES) @@ -174,7 +174,6 @@ program read_atm_grib2 if (levp1_input /= EXPECTED_LEVP1_INPUT) stop 3 allocate(data3d_one_tile(i_input,j_input,lev_input)) - allocate(data4d_one_tile(i_input,j_input,lev_input,3)) allocate(data_one_tile(i_input,j_input)) ! The i/j/k of the points to be checked. @@ -231,13 +230,15 @@ program read_atm_grib2 if (abs(data3d_one_tile(i_check(1),j_check(1),k_check(1)) - expected_values_pres(1)) > EPSILON) stop 22 if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_pres(2)) > EPSILON) stop 23 - call ESMF_FieldGather(wind_input_grid, data4d_one_tile, rootPet=0, rc=rc) - if (abs(data4d_one_tile(i_check(1),j_check(1),k_check(1),1) - expected_values_xwind(1)) > EPSILON) stop 24 - if (abs(data4d_one_tile(i_check(2),j_check(2),k_check(2),1) - expected_values_xwind(2)) > EPSILON) stop 25 - if (abs(data4d_one_tile(i_check(1),j_check(1),k_check(1),2) - expected_values_ywind(1)) > EPSILON) stop 26 - if (abs(data4d_one_tile(i_check(2),j_check(2),k_check(2),2) - expected_values_ywind(2)) > EPSILON) stop 27 - if (abs(data4d_one_tile(i_check(1),j_check(1),k_check(1),3) - expected_values_zwind(1)) > EPSILON) stop 28 - if (abs(data4d_one_tile(i_check(2),j_check(2),k_check(2),3) - expected_values_zwind(2)) > EPSILON) stop 29 + call ESMF_FieldGather(xwind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(i_check(1),j_check(1),k_check(1)) - expected_values_xwind(1)) > EPSILON) stop 24 + if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_xwind(2)) > EPSILON) stop 25 + call ESMF_FieldGather(ywind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(i_check(1),j_check(1),k_check(1)) - expected_values_ywind(1)) > EPSILON) stop 26 + if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_ywind(2)) > EPSILON) stop 27 + call ESMF_FieldGather(zwind_input_grid, data3d_one_tile, rootPet=0, rc=rc) + if (abs(data3d_one_tile(i_check(1),j_check(1),k_check(1)) - expected_values_zwind(1)) > EPSILON) stop 28 + if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_zwind(2)) > EPSILON) stop 29 call ESMF_FieldGather(ps_input_grid, data_one_tile, rootPet=0, rc=rc) if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_ps(1)) > EPSILON) stop 32 @@ -245,7 +246,7 @@ program read_atm_grib2 call ESMF_FieldGather(terrain_input_grid, data_one_tile, rootPet=0, rc=rc) if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_terrain(1)) > EPSILON) stop 34 - deallocate(latitude, longitude, data3d_one_tile, data4d_one_tile, data_one_tile) + deallocate(latitude, longitude, data3d_one_tile, data_one_tile) call ESMF_finalize(endflag=ESMF_END_KEEPMPI) diff --git a/util/gdas_init/driver.wcoss2.sh b/util/gdas_init/driver.wcoss2.sh index 76a3bb329..8d9f6ced5 100755 --- a/util/gdas_init/driver.wcoss2.sh +++ b/util/gdas_init/driver.wcoss2.sh @@ -127,10 +127,15 @@ if [ $RUN_CHGRES == yes ]; then if [ $CRES_HIRES == 'C768' ] ; then MEM=250GB elif [ $CRES_HIRES == 'C1152' ] ; then - MEM=350GB + MEM=500GB NODES=1 TASKS_PER_NODE=48 WALLT="0:20:00" + elif [ $CRES_HIRES == 'C3072' ] ; then + MEM=500GB + NODES=8 + TASKS_PER_NODE=18 + WALLT="0:45:00" fi NCPUS=${TASKS_PER_NODE} (( TASKS = NODES * TASKS_PER_NODE ))