From 5dd634050be9799ab2a37e3161367f67c006fa5e Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 27 Jan 2021 21:15:03 +0000 Subject: [PATCH 01/12] feature/new_ip Updates to compile with the combined ip/ip2 library. Issue #242 --- modulefiles/build.hera.intel | 3 +- sorc/emcsfc_snow2mdl.fd/snow2mdl.f | 32 +++--- sorc/global_chgres.fd/chgres_utils.f90 | 10 +- sorc/global_chgres.fd/nsst_chgres.f90 | 3 +- sorc/global_chgres.fd/surface_chgres.f90 | 103 +++++++++++------- .../orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f | 76 ++----------- 6 files changed, 100 insertions(+), 127 deletions(-) diff --git a/modulefiles/build.hera.intel b/modulefiles/build.hera.intel index 3774f7def..f1352f8af 100644 --- a/modulefiles/build.hera.intel +++ b/modulefiles/build.hera.intel @@ -13,7 +13,8 @@ module load hpc-impi/2018.0.4 module load bacio/2.4.1 module load g2/3.4.1 -module load ip/3.3.3 +#module load ip/3.3.3 +setenv ip_ROOT /home/Kyle.Gerheiser/NCEPLIBS-ip2/build/install module load nemsio/2.5.2 module load sp/2.3.3 module load w3emc/2.7.3 diff --git a/sorc/emcsfc_snow2mdl.fd/snow2mdl.f b/sorc/emcsfc_snow2mdl.fd/snow2mdl.f index cda286ec8..7f5735b46 100755 --- a/sorc/emcsfc_snow2mdl.fd/snow2mdl.f +++ b/sorc/emcsfc_snow2mdl.fd/snow2mdl.f @@ -175,15 +175,16 @@ subroutine interp !$$$ use gdswzd_mod + use ipolates_mod implicit none integer :: i, j, ii, jj, ij integer :: ijmdl2, istart, iend, imid, iii integer, allocatable :: idum(:,:) - integer :: int_opt, ipopt(20) + integer :: int_opt, ipopt(20), ibi(1) integer :: kgds_mdl_tmp(200) - integer :: no, ibo, iret, nret + integer :: no, ibo(1), iret, nret logical*1, allocatable :: bitmap_mdl(:) @@ -248,6 +249,7 @@ subroutine interp NESDIS_IMS : if (use_nesdis) then ipopt = 0 + ibi = 1 if (nesdis_res < (0.5*resol_mdl)) then print*,"- INTERPOLATE NH NESDIS/IMS DATA TO MODEL GRID USING BUDGET METHOD." ipopt(1)=2 ! break model grid cell into 25 points. @@ -274,9 +276,9 @@ subroutine interp bitmap_mdl=.false. ! if interpolation routine can't find data ! at a point, this flag is false. - call ipolates(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, & (inesdis*jnesdis), ijmdl, & - 1, 1, bitmap_nesdis, snow_cvr_nesdis, & + 1, ibi, bitmap_nesdis, snow_cvr_nesdis, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_cvr_mdl_1d, iret) @@ -302,7 +304,7 @@ subroutine interp if (lats_mdl(ij) <= lat_threshold) then snow_cvr_mdl_1d(ij) = 0.0 else - call gdswzd(kgds_nesdis,-1,1,undefined_value,gridi,gridj, & + call gdswzd_grib1(kgds_nesdis,-1,1,undefined_value,gridi,gridj, & lons_mdl(ij),lats_mdl(ij),nret) if (nret /= 1) then print*,"- WARNING: MODEL POINT OUTSIDE NESDIS/IMS GRID: ", ipts_mdl(ij), jpts_mdl(ij) @@ -337,6 +339,7 @@ subroutine interp !---------------------------------------------------------------------- ipopt = 0 + ibi = 1 if (afwa_res < (0.5*resol_mdl)) then print*,"- INTERPOLATE GLOBAL AFWA DATA TO MODEL GRID USING BUDGET METHOD." ipopt(1)=-1 ! break model grid cell into 25 points. @@ -361,9 +364,9 @@ subroutine interp allocate (bitmap_mdl(ijmdl)) bitmap_mdl = .false. - call ipolates(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & - 1, 1, bitmap_afwa_global, snow_dep_afwa_global, & + 1, ibi, bitmap_afwa_global, snow_dep_afwa_global, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_dep_mdl_tmp, iret) @@ -408,6 +411,7 @@ subroutine interp !---------------------------------------------------------------------- ipopt = 0 + ibi = 1 if (afwa_res < (0.5*resol_mdl)) then print*,"- INTERPOLATE NH AFWA DATA TO MODEL GRID USING BUDGET METHOD." ipopt(1)=-1 ! break model grid cell into 25 points. @@ -432,9 +436,9 @@ subroutine interp allocate (bitmap_mdl(ijmdl)) bitmap_mdl = .false. - call ipolates(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & - 1, 1, bitmap_afwa_nh, snow_dep_afwa_nh, & + 1, ibi, bitmap_afwa_nh, snow_dep_afwa_nh, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_dep_mdl_tmp, iret) @@ -545,6 +549,7 @@ subroutine interp AUTOSNOW : if (use_autosnow) then ipopt = 0 + ibi = 1 if (autosnow_res < (0.5*resol_mdl)) then print*,"- INTERPOLATE AUTOSNOW DATA TO MODEL GRID USING BUDGET METHOD." ipopt(1)=2 ! break model grid cell into 25 points. @@ -571,9 +576,9 @@ subroutine interp bitmap_mdl=.false. ! if interpolation routine can't find data ! at a point, this flag is false. - call ipolates(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, & (iautosnow*jautosnow), ijmdl, & - 1, 1, bitmap_autosnow, snow_cvr_autosnow, & + 1, ibi, bitmap_autosnow, snow_cvr_autosnow, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_cvr_mdl_1d, iret) @@ -618,6 +623,7 @@ subroutine interp !---------------------------------------------------------------------- ipopt = 0 + ibi = 1 if (afwa_res < (0.5*resol_mdl)) then print*,"- INTERPOLATE SH AFWA DATA TO MODEL GRID USING BUDGET METHOD." ipopt(1)=-1 ! break model grid cell into 25 points. @@ -642,9 +648,9 @@ subroutine interp allocate (bitmap_mdl(ijmdl)) bitmap_mdl = .false. - call ipolates(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & - 1, 1, bitmap_afwa_sh, snow_dep_afwa_sh, & + 1, ibi, bitmap_afwa_sh, snow_dep_afwa_sh, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_dep_mdl_tmp, iret) diff --git a/sorc/global_chgres.fd/chgres_utils.f90 b/sorc/global_chgres.fd/chgres_utils.f90 index e6bab2c23..5b921ff6d 100755 --- a/sorc/global_chgres.fd/chgres_utils.f90 +++ b/sorc/global_chgres.fd/chgres_utils.f90 @@ -20,10 +20,11 @@ !! - ipolates() IREDELL'S POLATE FOR SCALAR FIELDS !! SUBROUTINE GL2ANY(IP,KM,G1,IM1,JM1,G2,IM2,JM2,RLON,RLAT) + use ipolates_mod IMPLICIT NONE INTEGER, INTENT(IN) :: IP, KM, IM1, JM1, IM2, JM2 REAL, INTENT(IN) :: G1(IM1,JM1,KM) - REAL, INTENT(IN) :: RLAT(IM2,JM2),RLON(IM2,JM2) + REAL, INTENT(INOUT) :: RLAT(IM2,JM2),RLON(IM2,JM2) REAL, INTENT(OUT) :: G2(IM2,JM2,KM) LOGICAL*1 :: L1(IM1,JM1,KM),L2(IM2,JM2,KM) INTEGER :: IB1(KM),IB2(KM) @@ -41,7 +42,7 @@ SUBROUTINE GL2ANY(IP,KM,G1,IM1,JM1,G2,IM2,JM2,RLON,RLAT) KGDS1(3)=JM1 KGDS1(8)=NINT(-360000./IM1) KGDS1(10)=JM1/2 - CALL IPOLATES(IP,IPOPT,KGDS1,KGDS2,IM1*JM1,IM2*JM2,KM,IB1,L1,G1, & + CALL IPOLATES_GRIB1(IP,IPOPT,KGDS1,KGDS2,IM1*JM1,IM2*JM2,KM,IB1,L1,G1, & NO,RLAT,RLON,IB2,L2,G2,IRET) IF(IRET/=0)THEN PRINT*,'FATAL ERROR IN ROUTINE GL2ANY, IRET: ', IRET @@ -85,10 +86,11 @@ SUBROUTINE GL2ANYV(IP,KM,G1U,G1V,IM1,JM1,G2U,G2V,IM2,JM2,RLON,RLAT) ! LANGUAGE: FORTRAN 90 ! !C$$$ + use ipolatev_mod IMPLICIT NONE INTEGER, INTENT(IN) :: IP, KM, IM1, JM1, IM2, JM2 REAL, INTENT(IN) :: G1U(IM1,JM1,KM), G1V(IM1,JM1,KM) - REAL, INTENT(IN) :: RLAT(IM2,JM2),RLON(IM2,JM2) + REAL, INTENT(INOUT) :: RLAT(IM2,JM2),RLON(IM2,JM2) REAL, INTENT(OUT) :: G2U(IM2,JM2,KM), G2V(IM2,JM2,KM) LOGICAL*1 :: L1(IM1,JM1,KM),L2(IM2,JM2,KM) INTEGER :: IB1(KM),IB2(KM) @@ -109,7 +111,7 @@ SUBROUTINE GL2ANYV(IP,KM,G1U,G1V,IM1,JM1,G2U,G2V,IM2,JM2,RLON,RLAT) KGDS1(10)=JM1/2 CROT = 1.0 ! DONT ROTATE WINDS TO THE OUTPUT GRID. SROT = 0.0 ! FV3 EXPECTS EARTH RELATIVE WINDS. - CALL IPOLATEV(IP,IPOPT,KGDS1,KGDS2,IM1*JM1,IM2*JM2,KM,IB1,L1,G1U, & + CALL IPOLATEV_GRIB1(IP,IPOPT,KGDS1,KGDS2,IM1*JM1,IM2*JM2,KM,IB1,L1,G1U, & G1V,NO,RLAT,RLON,CROT,SROT,IB2,L2,G2U,G2V,IRET) IF(IRET/=0)THEN PRINT*,'FATAL ERROR IN ROUTINE GL2ANYV, IRET: ', IRET diff --git a/sorc/global_chgres.fd/nsst_chgres.f90 b/sorc/global_chgres.fd/nsst_chgres.f90 index 7fe7e317a..bbb8587ea 100644 --- a/sorc/global_chgres.fd/nsst_chgres.f90 +++ b/sorc/global_chgres.fd/nsst_chgres.f90 @@ -23,6 +23,7 @@ subroutine nsst_chgres(im_input, jm_input, & data_input, mask_input, data_output, num_nsst_fields, & kgds_output, rlat_output, rlon_output) + use ipolates_mod implicit none integer, intent(in) :: imo @@ -178,7 +179,7 @@ subroutine nsst_chgres(im_input, jm_input, & iret =0 ij_input =im_input*jm_input - call ipolates(ip,ipopt,kgds_input,kgds,ij_input,count_water,& + call ipolates_grib1(ip,ipopt,kgds_input,kgds,ij_input,count_water,& num_nsst_fields, ibi, bitmap_input, data_input, & count_water,rlat_water,rlon_water,ibo,bitmap_water, & data_water,iret) diff --git a/sorc/global_chgres.fd/surface_chgres.f90 b/sorc/global_chgres.fd/surface_chgres.f90 index 7b57ab69d..639d57a5d 100755 --- a/sorc/global_chgres.fd/surface_chgres.f90 +++ b/sorc/global_chgres.fd/surface_chgres.f90 @@ -464,6 +464,7 @@ subroutine interp (imdl_input, jmdl_input, & calc_liq_soilm, calc_albedo use gdswzd_mod + use ipolates_mod implicit none @@ -811,18 +812,20 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_nonland_output allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 allocate(input_dat(imdl_input,jmdl_input,1)) input_dat(:,:,1)=float(input%sea_ice_flag) - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_nonland_output, & - 1, 1, bitmap_nonland_input, input_dat, & + 1, ibi, bitmap_nonland_input, input_dat, & no, lats_nonland_output, lons_nonland_output, ibo, & bitmap_nonland_output, output_data_nonland, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! is grid all non-land? output%sea_ice_flag = 0 ! land do ij = 1, count_nonland_output @@ -846,17 +849,19 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_nonland_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_nonland_output, & - 1, 1, bitmap_nonland_input, input%sea_ice_fract, & + 1, ibi, bitmap_nonland_input, input%sea_ice_fract, & no, lats_nonland_output, lons_nonland_output, ibo, & bitmap_nonland_output, output_data_nonland, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! is grid all non-land? output%sea_ice_flag = 0 ! land do ij = 1, count_nonland_output @@ -964,10 +969,12 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_sea_ice_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_sea_ice_output, & - 1, 1, bitmap_sea_ice_input, input%sea_ice_depth, & + 1, ibi, bitmap_sea_ice_input, input%sea_ice_depth, & no, lats_sea_ice_output, lons_sea_ice_output, & ibo, bitmap_sea_ice_output, & output_data_sea_ice, iret) @@ -975,7 +982,7 @@ subroutine interp (imdl_input, jmdl_input, & print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) output%sea_ice_depth = 0.0 ! open water/land do ij = 1, count_sea_ice_output if (bitmap_sea_ice_output(ij)) then @@ -1123,17 +1130,19 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_land_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%skin_temp, & + 1, ibi, bitmap_land_input, input%skin_temp, & no, lats_land_output, lons_land_output, ibo, & bitmap_land_output, output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES SKIN TEMP LAND',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? output%skin_temp= 0.0 do ij = 1, count_land_output @@ -1152,17 +1161,19 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_nonland_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_nonland_output, & - 1, 1, bitmap_nonland_input, input%skin_temp, & + 1, ibi, bitmap_nonland_input, input%skin_temp, & no, lats_nonland_output, lons_nonland_output, ibo, & bitmap_nonland_output, output_data_nonland, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES SKIN TEMP NON LAND',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif do ij = 1, count_nonland_output if (bitmap_nonland_output(ij)) then @@ -1277,7 +1288,7 @@ subroutine interp (imdl_input, jmdl_input, & allocate(ibo(nsoil_input)) allocate(ibi(nsoil_input)) ibi=1 - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_sea_ice_output, & nsoil_input, ibi, bitmap_sea_ice_input2, input_dat, & no, lats_sea_ice_output, lons_sea_ice_output, ibo, & @@ -1336,16 +1347,18 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_land_output allocate(ibo(1)) - call ipolates(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & + allocate(ibi(1)) + ibi=1 + call ipolates_grib1(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%snow_liq_equiv, & + 1, ibi, bitmap_land_input, input%snow_liq_equiv, & no, lats_land_output, lons_land_output, ibo, bitmap_land_output, & output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES FOR SNOW LIQUID EQUIVALENT ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? output%snow_liq_equiv= 0.0 ! non-land ! the budget interpolation can spread very shallow amounts of snow over @@ -1374,16 +1387,18 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_sea_ice_output allocate(ibo(1)) - call ipolates(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & + allocate(ibi(1)) + ibi=1 + call ipolates_grib1(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_sea_ice_output, & - 1, 1, bitmap_sea_ice_input, input%snow_liq_equiv, & + 1, ibi, bitmap_sea_ice_input, input%snow_liq_equiv, & no, lats_sea_ice_output, lons_sea_ice_output, ibo, & bitmap_sea_ice_output, output_data_sea_ice, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) do ij = 1, count_sea_ice_output if (bitmap_sea_ice_output(ij)) then output%snow_liq_equiv(ijsav_sea_ice_output(ij))=output_data_sea_ice(ij) @@ -1431,17 +1446,19 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_land_output - call ipolates(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%snow_depth, & + 1, ibi, bitmap_land_input, input%snow_depth, & no, lats_land_output, lons_land_output, ibo, bitmap_land_output, & output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? ! note: very shallow amounts of liquid equivalent are zeroed out ! when the budget interpolation is used. make sure depth is consistent. @@ -1474,16 +1491,18 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_sea_ice_output allocate(ibo(1)) - call ipolates(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & + allocate(ibi(1)) + ibi=1 + call ipolates_grib1(int_opt_snow, ipopt_snow, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_sea_ice_output, & - 1, 1, bitmap_sea_ice_input, input%snow_depth, & + 1, ibi, bitmap_sea_ice_input, input%snow_depth, & no, lats_sea_ice_output, lons_sea_ice_output, ibo, & bitmap_sea_ice_output, output_data_sea_ice, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) do ij = 1, count_sea_ice_output if (bitmap_sea_ice_output(ij)) then ! ipolates found data ! ensure interpolated liq equiv is consistent with depth @@ -1633,17 +1652,19 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp=kgds_output kgds_output_tmp(1) = kgdso1 allocate(ibo(1)) + allocate(ibi(1)) + ibi=1 no=count_land_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%greenfrc, & + 1, ibi, bitmap_land_input, input%greenfrc, & no, lats_land_output, lons_land_output, ibo, & bitmap_land_output, output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? output%greenfrc= 0.0 ! non-land do ij = 1, count_land_output @@ -1713,7 +1734,7 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 allocate(ibo(2)) no=count_land_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & 2, (/1,1/), bitmap_land_input2, input_dat, & no, lats_land_output, lons_land_output, ibo, & @@ -1870,7 +1891,7 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 allocate(ibo(6)) no=count_land_output - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & 6, (/1,1,1,1,1,1/), bitmap_land_input2, input_dat, & no, lats_land_output, lons_land_output, ibo, & @@ -1974,16 +1995,18 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_land_output allocate(ibo(1)) - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + allocate(ibi(1)) + ibi=1 + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%snow_free_albedo, & + 1, ibi, bitmap_land_input, input%snow_free_albedo, & no, lats_land_output, lons_land_output, ibo, & bitmap_land_output, output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? output%snow_free_albedo = 0.06 ! open water do ij = 1, count_land_output @@ -2019,16 +2042,18 @@ subroutine interp (imdl_input, jmdl_input, & kgds_output_tmp(1) = kgdso1 no=count_land_output allocate(ibo(1)) - call ipolates(int_opt, ipopt, kgds_input, kgds_output_tmp, & + allocate(ibi(1)) + ibi=1 + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output_tmp, & (imdl_input*jmdl_input), count_land_output, & - 1, 1, bitmap_land_input, input%mxsnow_alb, & + 1, ibi, bitmap_land_input, input%mxsnow_alb, & no, lats_land_output, lons_land_output, ibo, bitmap_land_output, & output_data_land, iret) if (iret /= 0) then print*,'- ERROR IN IPOLATES ',iret return endif - deallocate(ibo) + deallocate(ibo,ibi) endif ! are there land points? output%mxsnow_alb= 0.0 ! non-land do ij = 1, count_land_output diff --git a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f index 98a0df836..dcf9247df 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f +++ b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f @@ -3115,70 +3115,6 @@ SUBROUTINE MAKEOA2(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, RETURN END - -C----------------------------------------------------------------------- - SUBROUTINE GL2ANY(IP,KM,G1,IM1,JM1,G2,IM2,JM2,IDRTI,RLON,RLAT) -C$$$ SUBPROGRAM DOCUMENTATION BLOCK -C -C SUBPROGRAM: GL2GL INTERPOLATE GAUSSIAN GRID TO GAUSSIAN GRID -C PRGMMR: IREDELL ORG: W/NMC23 DATE: 92-10-31 -C -C ABSTRACT: LINEARLY INTERPOLATES GAUSSIAN GRID TO GAUSSIAN GRID. -C -C PROGRAM HISTORY LOG: -C 91-10-31 MARK IREDELL -C -C USAGE: CALL GL2GL(IP,KM,G1,IM1,JM1,G2,IM2,JM2) -C INPUT ARGUMENT LIST: -C IP INTEGER INTERPOLATION TYPE -C KM INTEGER NUMBER OF LEVELS -C G1 REAL (IM1,JM1,KM) INPUT GAUSSIAN FIELD -C IM1 INTEGER NUMBER OF INPUT LONGITUDES -C JM1 INTEGER NUMBER OF INPUT LATITUDES -C IM2 INTEGER NUMBER OF OUTPUT LONGITUDES -C JM2 INTEGER NUMBER OF OUTPUT LATITUDES -C OUTPUT ARGUMENT LIST: -C G2 REAL (IM2,JM2,KM) OUTPUT GAUSSIAN FIELD -C -C SUBPROGRAMS CALLED: -C IPOLATES IREDELL'S POLATE FOR SCALAR FIELDS -C -C ATTRIBUTES: -C LANGUAGE: FORTRAN -C -CC$$$ - REAL G1(IM1,JM1,KM),G2(IM2,JM2,KM) - LOGICAL*1 L1(IM1,JM1,KM),L2(IM2,JM2,KM) - REAL, intent(in) :: RLAT(IM2,JM2),RLON(IM2,JM2) - INTEGER IB1(KM),IB2(KM) - INTEGER KGDS1(200),KGDS2(200) - INTEGER IDRTI, IDRTO - DATA KGDS1/4,0,0,90000,0,0,-90000,193*0/ - DATA KGDS2/4,0,0,90000,0,0,-90000,193*0/ - INTEGER IPOPT(20) - DATA IPOPT/20*0/ -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KGDS1(1) = IDRTI - KGDS2(1) = -1 - NO = IM2*JM2 - IF(IM1.NE.IM2.OR.JM1.NE.JM2) THEN - IB1=0 - KGDS1(2)=IM1 - KGDS1(3)=JM1 - KGDS1(8)=NINT(-360000./IM1) - KGDS1(10)=JM1/2 - KGDS2(2)=IM2 - KGDS2(3)=JM2 - KGDS2(8)=NINT(-360000./IM2) - KGDS2(10)=JM2/2 - CALL IPOLATES(IP,IPOPT,KGDS1,KGDS2,IM1*JM1,IM2*JM2,KM,IB1,L1,G1, - & NO,RLAT,RLON,IB2,L2,G2,IRET) - ELSE - G2=G1 - ENDIF - END - - function spherical_distance(theta1,phi1,theta2,phi2) real, intent(in) :: theta1, phi1, theta2, phi2 @@ -3285,6 +3221,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, 2 IM,JM,IMN,JMN,lon_c,lat_c,lon_t,lat_t, 3 is_south_pole,is_north_pole,IMI,JMI,OA_IN,OL_IN, 4 slm_in,lon_in,lat_in) + use ipolates_mod implicit none real, parameter :: MISSING_VALUE = -9999. real, parameter :: D2R = 3.14159265358979/180. @@ -3324,7 +3261,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, integer int_opt, ipopt(20), kgds_input(200), kgds_output(200) integer count_land_output integer ij, ijmdl_output, iret, num_mismatch_land, num - integer ibo(1) + integer ibo(1), ibi(1) logical*1, allocatable :: bitmap_input(:,:) logical*1, allocatable :: bitmap_output(:) integer, allocatable :: ijsav_land_output(:) @@ -3489,13 +3426,14 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, oa4 = 0.0 ol = 0.0 + ibi = 1 do KWD=1,4 bitmap_output = .false. output_data_land = 0.0 - call ipolates(int_opt, ipopt, kgds_input, kgds_output, + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output, & (IMI*JMI), count_land_output, - & 1, 1, bitmap_input, oa_in(:,:,KWD), + & 1, ibi, bitmap_input, oa_in(:,:,KWD), & count_land_output, lats_land_output, & lons_land_output, ibo, & bitmap_output, output_data_land, iret) @@ -3565,9 +3503,9 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, do KWD=1,4 bitmap_output = .false. output_data_land = 0.0 - call ipolates(int_opt, ipopt, kgds_input, kgds_output, + call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output, & (IMI*JMI), count_land_output, - & 1, 1, bitmap_input, ol_in(:,:,KWD), + & 1, ibi, bitmap_input, ol_in(:,:,KWD), & count_land_output, lats_land_output, & lons_land_output, ibo, & bitmap_output, output_data_land, iret) From 7d4d516a2516b9e5d9cd860f06637b8b17078bf8 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 9 Sep 2022 19:06:06 +0000 Subject: [PATCH 02/12] Point to my local copy of ip v4 on wcoss2. Increase the rank of some arrays to comply with the new gdswzd and ipolates routine interfaces. Fixes #242. --- modulefiles/build.wcoss2.intel.lua | 3 +- sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 | 145 ++++++++++++++------------- 2 files changed, 76 insertions(+), 72 deletions(-) diff --git a/modulefiles/build.wcoss2.intel.lua b/modulefiles/build.wcoss2.intel.lua index e3869cc8a..25b79a3ed 100644 --- a/modulefiles/build.wcoss2.intel.lua +++ b/modulefiles/build.wcoss2.intel.lua @@ -51,8 +51,7 @@ load(pathJoin("sigio", sigio_ver)) sp_ver=os.getenv("sp_ver") or "2.3.3" load(pathJoin("sp", sp_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" -load(pathJoin("ip", ip_ver)) +setenv("ip_DIR","/lfs/h2/emc/global/noscrub/George.Gayno/ip.git/lib64/cmake/ip") g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) diff --git a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 index 6599bcd28..c75188825 100755 --- a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 +++ b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 @@ -160,20 +160,22 @@ subroutine interp implicit none + integer, parameter :: km=1 + integer :: i, j, ii, jj, ij integer :: ijmdl2, istart, iend, imid, iii integer, allocatable :: idum(:,:) - integer :: int_opt, ipopt(20), ibi(1) + integer :: int_opt, ipopt(20), ibi(km) integer :: kgds_mdl_tmp(200) - integer :: no, ibo(1), iret, nret + integer :: no, ibo(km), iret, nret - logical*1, allocatable :: bitmap_mdl(:) + logical*1, allocatable :: bitmap_mdl(:,:) - real :: gridi(1) - real :: gridj(1) + real :: gridi(1), gridj(1) + real :: lats(1), lons(1) real, allocatable :: lsmask_1d(:) - real, allocatable :: snow_cvr_mdl_1d(:) - real, allocatable :: snow_dep_mdl_tmp(:) + real, allocatable :: snow_cvr_mdl_1d(:,:) + real, allocatable :: snow_dep_mdl_tmp(:,:) real :: sumc, sumd, x1, r, fraction, gridis, gridie real, parameter :: undefined_value = -999. @@ -250,16 +252,17 @@ subroutine interp no = ijmdl ! an input when kgds(1) < 0 (subset of grid) end if - allocate (snow_cvr_mdl_1d(ijmdl)) + allocate (snow_cvr_mdl_1d(ijmdl,km)) snow_cvr_mdl_1d = 0.0 - allocate (bitmap_mdl(ijmdl)) + allocate (bitmap_mdl(ijmdl,km)) bitmap_mdl=.false. ! if interpolation routine can't find data ! at a point, this flag is false. - call ipolates_grib1(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, & + + call ipolates(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, & (inesdis*jnesdis), ijmdl, & - 1, ibi, bitmap_nesdis, snow_cvr_nesdis, & + km, ibi, bitmap_nesdis, snow_cvr_nesdis, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_cvr_mdl_1d, iret) @@ -281,22 +284,24 @@ subroutine interp do ij = 1, ijmdl if (lats_mdl(ij) < 0.0) cycle ! only consider nh model points - if (.not. bitmap_mdl(ij)) then + if (.not. bitmap_mdl(ij,km)) then if (lats_mdl(ij) <= lat_threshold) then - snow_cvr_mdl_1d(ij) = 0.0 + snow_cvr_mdl_1d(ij,km) = 0.0 else - call gdswzd_grib1(kgds_nesdis,-1,1,undefined_value,gridi,gridj, & - lons_mdl(ij),lats_mdl(ij),nret) + lats(1)=lats_mdl(ij) + lons(1)=lons_mdl(ij) + call gdswzd(kgds_nesdis,-1,1,undefined_value,gridi,gridj, & + lons,lats,nret) if (nret /= 1) then print*,"- WARNING: MODEL POINT OUTSIDE NESDIS/IMS GRID: ", ipts_mdl(ij), jpts_mdl(ij) - snow_cvr_mdl_1d(ij) = 0.0 + snow_cvr_mdl_1d(ij,km) = 0.0 else ii = nint(gridi(1)) jj = nint(gridj(1)) if (sea_ice_nesdis(ii,jj) == 1) then - snow_cvr_mdl_1d(ij) = 100.0 + snow_cvr_mdl_1d(ij,km) = 100.0 else - snow_cvr_mdl_1d(ij) = 0.0 + snow_cvr_mdl_1d(ij,km) = 0.0 end if end if end if @@ -339,15 +344,15 @@ subroutine interp no = ijmdl ! an input when kgds(1) < 0 (subset of grid) end if - allocate (snow_dep_mdl_tmp(ijmdl)) + allocate (snow_dep_mdl_tmp(ijmdl,km)) snow_dep_mdl_tmp = 0.0 - allocate (bitmap_mdl(ijmdl)) + allocate (bitmap_mdl(ijmdl,km)) bitmap_mdl = .false. - call ipolates_grib1(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, & + call ipolates(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & - 1, ibi, bitmap_afwa_global, snow_dep_afwa_global, & + km, ibi, bitmap_afwa_global, snow_dep_afwa_global, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & snow_dep_mdl_tmp, iret) @@ -367,11 +372,11 @@ subroutine interp !---------------------------------------------------------------------- do ij = 1, ijmdl - if (.not. bitmap_mdl(ij)) then + if (.not. bitmap_mdl(ij,km)) then if (abs(lats_mdl(ij)) >= lat_threshold) then - snow_dep_mdl_tmp(ij) = min_snow_depth + snow_dep_mdl_tmp(ij,km) = min_snow_depth else - snow_dep_mdl_tmp(ij) = 0.0 + snow_dep_mdl_tmp(ij,km) = 0.0 endif endif enddo @@ -411,13 +416,13 @@ subroutine interp no = ijmdl ! an input when kgds(1) < 0 (subset of grid) end if - allocate (snow_dep_mdl_tmp(ijmdl)) + allocate (snow_dep_mdl_tmp(ijmdl,km)) snow_dep_mdl_tmp = 0.0 - allocate (bitmap_mdl(ijmdl)) + allocate (bitmap_mdl(ijmdl,km)) bitmap_mdl = .false. - call ipolates_grib1(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, & + call ipolates(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & 1, ibi, bitmap_afwa_nh, snow_dep_afwa_nh, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & @@ -440,11 +445,11 @@ subroutine interp do ij = 1, ijmdl if (lats_mdl(ij) >= 0.) then ! only consider model pts in n hemi. - if (.not. bitmap_mdl(ij)) then + if (.not. bitmap_mdl(ij,km)) then if (abs(lats_mdl(ij)) >= lat_threshold) then - snow_dep_mdl_tmp(ij) = min_snow_depth + snow_dep_mdl_tmp(ij,km) = min_snow_depth else - snow_dep_mdl_tmp(ij) = 0.0 + snow_dep_mdl_tmp(ij,km) = 0.0 endif endif endif @@ -468,11 +473,11 @@ subroutine interp print*,"- BLEND NESDIS/IMS AND AFWA DATA IN NH." do ij = 1, ijmdl if (lats_mdl(ij) >= 0.0) then - if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold) then + if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold) then snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = & - max(snow_dep_mdl_tmp(ij), min_snow_depth) + max(snow_dep_mdl_tmp(ij,km), min_snow_depth) endif - snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij) + snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km) endif enddo deallocate (snow_cvr_mdl_1d) @@ -480,11 +485,11 @@ subroutine interp print*,"- BLEND NESDIS/IMS AND AFWA DATA IN NH." do ij = 1, ijmdl if (lats_mdl(ij) >= 0.0) then - if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold) then + if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold) then snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = & - max(snow_dep_mdl_tmp(ij), min_snow_depth) + max(snow_dep_mdl_tmp(ij,km), min_snow_depth) endif - snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij) + snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km) endif enddo deallocate (snow_cvr_mdl_1d) @@ -493,9 +498,9 @@ subroutine interp print*,"- SET DEPTH/COVER FROM AFWA DATA IN NH." do ij = 1, ijmdl if (lats_mdl(ij) >= 0.0) then - if (snow_dep_mdl_tmp(ij) > 0.0) then + if (snow_dep_mdl_tmp(ij,km) > 0.0) then snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0 - snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij) + snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km) endif endif enddo @@ -503,9 +508,9 @@ subroutine interp print*,"- SET DEPTH/COVER FROM AFWA DATA IN NH." do ij = 1, ijmdl if (lats_mdl(ij) >= 0.0) then - if (snow_dep_mdl_tmp(ij) > 0.0) then + if (snow_dep_mdl_tmp(ij,km) > 0.0) then snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0 - snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij) + snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km) endif endif enddo @@ -514,10 +519,10 @@ subroutine interp print*,"- SET DEPTH/COVER FROM NESDIS/IMS DATA IN NH." do ij = 1, ijmdl if (lats_mdl(ij) >= 0.0) then - if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold) then + if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold) then snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth endif - snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij) + snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km) endif enddo deallocate (snow_cvr_mdl_1d) @@ -550,14 +555,14 @@ subroutine interp no = ijmdl ! an input when kgds(1) < 0 (subset of grid) end if - allocate (snow_cvr_mdl_1d(ijmdl)) + allocate (snow_cvr_mdl_1d(ijmdl,km)) snow_cvr_mdl_1d = 0.0 - allocate (bitmap_mdl(ijmdl)) + allocate (bitmap_mdl(ijmdl,km)) bitmap_mdl=.false. ! if interpolation routine can't find data ! at a point, this flag is false. - call ipolates_grib1(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, & + call ipolates(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, & (iautosnow*jautosnow), ijmdl, & 1, ibi, bitmap_autosnow, snow_cvr_autosnow, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & @@ -578,11 +583,11 @@ subroutine interp do ij = 1, ijmdl if (lats_mdl(ij) < 0.0) then - if (.not. bitmap_mdl(ij)) then + if (.not. bitmap_mdl(ij,km)) then if (abs(lats_mdl(ij)) <= lat_threshold) then - snow_cvr_mdl_1d(ij) = 0.0 + snow_cvr_mdl_1d(ij,km) = 0.0 else - snow_cvr_mdl_1d(ij) = 100.0 + snow_cvr_mdl_1d(ij,km) = 100.0 end if end if end if @@ -623,13 +628,13 @@ subroutine interp no = ijmdl ! an input when kgds(1) < 0 (subset of grid) end if - allocate (snow_dep_mdl_tmp(ijmdl)) + allocate (snow_dep_mdl_tmp(ijmdl,km)) snow_dep_mdl_tmp = 0.0 - allocate (bitmap_mdl(ijmdl)) + allocate (bitmap_mdl(ijmdl,km)) bitmap_mdl = .false. - call ipolates_grib1(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, & + call ipolates(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, & (iafwa*jafwa), ijmdl, & 1, ibi, bitmap_afwa_sh, snow_dep_afwa_sh, & no, lats_mdl, lons_mdl, ibo, bitmap_mdl, & @@ -650,11 +655,11 @@ subroutine interp do ij = 1, ijmdl if (lats_mdl(ij) < 0.) then - if (.not. bitmap_mdl(ij)) then + if (.not. bitmap_mdl(ij,km)) then if (abs(lats_mdl(ij)) >= lat_threshold) then - snow_dep_mdl_tmp(ij) = min_snow_depth + snow_dep_mdl_tmp(ij,km) = min_snow_depth else - snow_dep_mdl_tmp(ij) = 0.0 + snow_dep_mdl_tmp(ij,km) = 0.0 endif endif endif @@ -673,11 +678,11 @@ subroutine interp print*,"- BLEND AUTOSNOW AND AFWA DATA IN SH." do ij = 1, ijmdl if (lats_mdl(ij) < 0.0) then - if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold) then + if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold) then snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = & - max(snow_dep_mdl_tmp(ij), min_snow_depth) + max(snow_dep_mdl_tmp(ij,km), min_snow_depth) endif - snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij) + snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km) endif enddo deallocate (snow_cvr_mdl_1d) @@ -686,9 +691,9 @@ subroutine interp print*,"- SET DEPTH/COVER FROM AFWA DATA IN SH." do ij = 1, ijmdl if (lats_mdl(ij) < 0.0) then - if (snow_dep_mdl_tmp(ij) > 0.0) then + if (snow_dep_mdl_tmp(ij,km) > 0.0) then snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0 - snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij) + snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km) endif endif enddo @@ -697,10 +702,10 @@ subroutine interp print*,"- SET DEPTH/COVER FROM AUTOSNOW IN SH." do ij = 1, ijmdl if (lats_mdl(ij) < 0.0) then - if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold) then + if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold) then snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth endif - snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij) + snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km) endif enddo deallocate (snow_cvr_mdl_1d) @@ -715,9 +720,9 @@ subroutine interp if (kgds_mdl(1) == 4 .and. thinned) then ijmdl2 = sum(lonsperlat_mdl) * 2 - allocate (snow_cvr_mdl_1d(ijmdl2)) + allocate (snow_cvr_mdl_1d(ijmdl2,km)) allocate (lsmask_1d(ijmdl2)) - allocate (snow_dep_mdl_tmp(ijmdl2)) + allocate (snow_dep_mdl_tmp(ijmdl2,km)) lsmask_1d = 0.0 snow_cvr_mdl_1d = 0.0 @@ -754,10 +759,10 @@ subroutine interp sumc = sumc + fraction * snow_cvr_mdl(iii,j) sumd = sumd + fraction * snow_dep_mdl(iii,j) enddo - snow_cvr_mdl_1d(ij) = sumc / r - snow_dep_mdl_tmp(ij) = 0.0 - if (snow_cvr_mdl_1d(ij) > snow_cvr_threshold) then - snow_dep_mdl_tmp(ij) = max(sumd / r,min_snow_depth) + snow_cvr_mdl_1d(ij,km) = sumc / r + snow_dep_mdl_tmp(ij,km) = 0.0 + if (snow_cvr_mdl_1d(ij,km) > snow_cvr_threshold) then + snow_dep_mdl_tmp(ij,km) = max(sumd / r,min_snow_depth) end if enddo enddo @@ -771,9 +776,9 @@ subroutine interp allocate (idum(imdl,jmdl)) idum = 0 call uninterpred(1, idum, lsmask_1d, lsmask_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl) - call uninterpred(1, idum, snow_cvr_mdl_1d, snow_cvr_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl) + call uninterpred(1, idum, snow_cvr_mdl_1d(:,km), snow_cvr_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl) deallocate(snow_cvr_mdl_1d) - call uninterpred(1, idum, snow_dep_mdl_tmp, snow_dep_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl) + call uninterpred(1, idum, snow_dep_mdl_tmp(:,km), snow_dep_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl) deallocate(snow_dep_mdl_tmp) deallocate(idum) From c70851d263f5d60dc4bd0e525336fc0f4e1a5ee7 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 9 Sep 2022 19:49:29 +0000 Subject: [PATCH 03/12] Update orography code so it can call either v4 or v3.3.3 of iplib. Fixes #242 --- .../orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f index 70799818f..b4d802165 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f +++ b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f @@ -3596,11 +3596,11 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, integer ij, ijmdl_output, iret, num_mismatch_land, num integer ibo(1), ibi(1) logical*1, allocatable :: bitmap_input(:,:) - logical*1, allocatable :: bitmap_output(:) + logical*1, allocatable :: bitmap_output(:,:) integer, allocatable :: ijsav_land_output(:) real, allocatable :: lats_land_output(:) real, allocatable :: lons_land_output(:) - real, allocatable :: output_data_land(:) + real, allocatable :: output_data_land(:,:) real, allocatable :: lons_mismatch_output(:) real, allocatable :: lats_mismatch_output(:) real, allocatable :: data_mismatch_output(:) @@ -3737,8 +3737,8 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, where(slm_in > 0.0) bitmap_input=.true. print*, "count(bitmap_input)", count(bitmap_input) - allocate(bitmap_output(count_land_output)) - allocate(output_data_land(count_land_output)) + allocate(bitmap_output(count_land_output,1)) + allocate(output_data_land(count_land_output,1)) allocate(ijsav_land_output(count_land_output)) allocate(lats_land_output(count_land_output)) allocate(lons_land_output(count_land_output)) @@ -3764,7 +3764,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, do KWD=1,4 bitmap_output = .false. output_data_land = 0.0 - call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output, + call ipolates(int_opt, ipopt, kgds_input, kgds_output, & (IMI*JMI), count_land_output, & 1, ibi, bitmap_input, oa_in(:,:,KWD), & count_land_output, lats_land_output, @@ -3777,10 +3777,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, num_mismatch_land = 0 do ij = 1, count_land_output - if (bitmap_output(ij)) then + if (bitmap_output(ij,1)) then j = (ijsav_land_output(ij)-1)/IM + 1 i = mod(ijsav_land_output(ij)-1,IM) + 1 - oa4(i,j,KWD)=output_data_land(ij) + oa4(i,j,KWD)=output_data_land(ij,1) else ! default value num_mismatch_land = num_mismatch_land + 1 endif @@ -3796,7 +3796,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, num = 0 do ij = 1, count_land_output - if (.not. bitmap_output(ij)) then + if (.not. bitmap_output(ij,1)) then num = num+1 lons_mismatch_output(num) = lons_land_output(ij) lats_mismatch_output(num) = lats_land_output(ij) @@ -3818,7 +3818,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, num = 0 do ij = 1, count_land_output - if (.not. bitmap_output(ij)) then + if (.not. bitmap_output(ij,1)) then num = num+1 j = (ijsav_land_output(ij)-1)/IM + 1 i = mod(ijsav_land_output(ij)-1,IM) + 1 @@ -3836,7 +3836,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, do KWD=1,4 bitmap_output = .false. output_data_land = 0.0 - call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output, + call ipolates(int_opt, ipopt, kgds_input, kgds_output, & (IMI*JMI), count_land_output, & 1, ibi, bitmap_input, ol_in(:,:,KWD), & count_land_output, lats_land_output, @@ -3849,10 +3849,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, num_mismatch_land = 0 do ij = 1, count_land_output - if (bitmap_output(ij)) then + if (bitmap_output(ij,1)) then j = (ijsav_land_output(ij)-1)/IM + 1 i = mod(ijsav_land_output(ij)-1,IM) + 1 - ol(i,j,KWD)=output_data_land(ij) + ol(i,j,KWD)=output_data_land(ij,1) else ! default value num_mismatch_land = num_mismatch_land + 1 endif @@ -3865,7 +3865,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, num = 0 do ij = 1, count_land_output - if (.not. bitmap_output(ij)) then + if (.not. bitmap_output(ij,1)) then num = num+1 j = (ijsav_land_output(ij)-1)/IM + 1 i = mod(ijsav_land_output(ij)-1,IM) + 1 From 59292b446ae8b4a7fe829f0021866f1e38a21577 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 9 Sep 2022 20:08:19 +0000 Subject: [PATCH 04/12] Mods to run with ip v3.3.3 for testing purposes. Fixes #242. --- modulefiles/build.wcoss2.intel.lua | 4 +++- sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 | 4 +++- sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modulefiles/build.wcoss2.intel.lua b/modulefiles/build.wcoss2.intel.lua index 25b79a3ed..5e10b66c9 100644 --- a/modulefiles/build.wcoss2.intel.lua +++ b/modulefiles/build.wcoss2.intel.lua @@ -51,7 +51,9 @@ load(pathJoin("sigio", sigio_ver)) sp_ver=os.getenv("sp_ver") or "2.3.3" load(pathJoin("sp", sp_ver)) -setenv("ip_DIR","/lfs/h2/emc/global/noscrub/George.Gayno/ip.git/lib64/cmake/ip") +ip_ver=os.getenv("ip_ver") or "3.3.3" +load(pathJoin("ip", ip_ver)) +-- setenv("ip_DIR","/lfs/h2/emc/global/noscrub/George.Gayno/ip.git/lib64/cmake/ip") g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) diff --git a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 index c75188825..bc438c59e 100755 --- a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 +++ b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 @@ -156,7 +156,9 @@ module snow2mdl !! @author George Gayno org: w/np2 @date 2005-Dec-16 subroutine interp use gdswzd_mod - use ipolates_mod + +! To use v4.0 of the IP library, uncomment this line. +! use ipolates_mod implicit none diff --git a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f index b4d802165..38738e8e4 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f +++ b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f @@ -3554,7 +3554,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, 2 IM,JM,IMN,JMN,lon_c,lat_c,lon_t,lat_t, 3 is_south_pole,is_north_pole,IMI,JMI,OA_IN,OL_IN, 4 slm_in,lon_in,lat_in) - use ipolates_mod + +! To use v4.0 of the ip library, uncomment this line. +! use ipolates_mod + implicit none real, parameter :: MISSING_VALUE = -9999. real, parameter :: D2R = 3.14159265358979/180. From 8e3842ed918e23c2d67f5904b333a2f6d5b3ddf8 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Mon, 12 Sep 2022 21:30:03 +0000 Subject: [PATCH 05/12] Rename orog code with capital F extension to use preprocessor directives. Fixes #242. --- sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt | 4 ++-- .../orog.fd/{mtnlm7_oclsm.f => mtnlm7_oclsm.F} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename sorc/orog_mask_tools.fd/orog.fd/{mtnlm7_oclsm.f => mtnlm7_oclsm.F} (100%) diff --git a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt index c292ec530..361a2d586 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt @@ -1,5 +1,5 @@ set(lib_src netcdf_io.F90) -set(exe_src mtnlm7_oclsm.f) +set(exe_src mtnlm7_oclsm.F) if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl") @@ -13,7 +13,7 @@ endif() set(exe_name orog) add_library(orog_lib STATIC ${lib_src}) -add_executable(${exe_name} mtnlm7_oclsm.f) +add_executable(${exe_name} mtnlm7_oclsm.F) set(mod_dir "${CMAKE_CURRENT_BINARY_DIR}/mod") set_target_properties(orog_lib PROPERTIES Fortran_MODULE_DIRECTORY ${mod_dir}) diff --git a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F similarity index 100% rename from sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f rename to sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F From 201754ff61b56e8296ec0cb273f8a28195f3a01b Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Tue, 13 Sep 2022 12:28:30 +0000 Subject: [PATCH 06/12] Add preprocessor directives the ipolates routine. Fixes #242. --- sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 | 6 ++++-- sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 index bc438c59e..802ca27b5 100755 --- a/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 +++ b/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 @@ -157,8 +157,10 @@ module snow2mdl subroutine interp use gdswzd_mod -! To use v4.0 of the IP library, uncomment this line. -! use ipolates_mod +! Required when using iplib v4.0 or higher. +#ifdef IP_V4 + use ipolates_mod +#endif implicit none diff --git a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F index 38738e8e4..438eefadf 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F +++ b/sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.F @@ -3555,8 +3555,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX, 3 is_south_pole,is_north_pole,IMI,JMI,OA_IN,OL_IN, 4 slm_in,lon_in,lat_in) -! To use v4.0 of the ip library, uncomment this line. -! use ipolates_mod +! Required when using iplib v4.0 or higher. +#ifdef IP_V4 + use ipolates_mod +#endif implicit none real, parameter :: MISSING_VALUE = -9999. From b2f7b7081c940789aa3503f738157b3847bb5125 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Tue, 13 Sep 2022 12:39:52 +0000 Subject: [PATCH 07/12] Update orog and snow2mdl build modules to include compiler preprocessor flag. Fixes #242. --- sorc/emcsfc_snow2mdl.fd/CMakeLists.txt | 3 +++ sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt b/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt index b20a722ee..057422d83 100644 --- a/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt +++ b/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt @@ -17,6 +17,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian") endif() +if(ip_VERSION GREATER_EQUAL 4.0.0) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4") +endif() set(exe_name emcsfc_snow2mdl) diff --git a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt index 361a2d586..7cede544b 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt @@ -9,6 +9,9 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz") endif() endif() +if(ip_VERSION GREATER_EQUAL 4.0.0) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4") +endif() set(exe_name orog) From 86818a301e3b5f3c224ff1bd32ad6de347685064 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Sep 2022 13:00:43 +0000 Subject: [PATCH 08/12] Use ip v4.0.0 on Hera. Fixes #242. --- modulefiles/build.hera.gnu.lua | 2 +- modulefiles/build.hera.intel.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.hera.gnu.lua b/modulefiles/build.hera.gnu.lua index 331aefe85..13bba4a26 100644 --- a/modulefiles/build.hera.gnu.lua +++ b/modulefiles/build.hera.gnu.lua @@ -31,7 +31,7 @@ load(pathJoin("bacio", bacio_ver)) g2_ver=os.getenv("g2_ver") or "3.4.3" load(pathJoin("g2", g2_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" +ip_ver=os.getenv("ip_ver") or "4.0.0" load(pathJoin("ip", ip_ver)) nemsio_ver=os.getenv("nemsio_ver") or "2.5.2" diff --git a/modulefiles/build.hera.intel.lua b/modulefiles/build.hera.intel.lua index d82571889..7a3a083ad 100644 --- a/modulefiles/build.hera.intel.lua +++ b/modulefiles/build.hera.intel.lua @@ -25,7 +25,7 @@ load(pathJoin("bacio", bacio_ver)) g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" +ip_ver=os.getenv("ip_ver") or "4.0.0" load(pathJoin("ip", ip_ver)) nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" From 794304ddc8391631f6099ebbebbd6d27d3c65d57 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 14 Oct 2022 16:14:51 -0500 Subject: [PATCH 09/12] Update orion build module to use ip v4.0. Fixes #242. --- modulefiles/build.orion.intel.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua index 80e5986d1..12a198969 100644 --- a/modulefiles/build.orion.intel.lua +++ b/modulefiles/build.orion.intel.lua @@ -5,7 +5,7 @@ Load environment to compile UFS_UTILS on Orion cmake_ver=os.getenv("cmake_ver") or "3.17.3" load(pathJoin("cmake", cmake_ver)) -prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack") +prepend_path("MODULEPATH", "/apps/contrib/NCEP/hpc-stack/libs/hpc-stack/modulefiles/stack") hpc_ver=os.getenv("hpc_ver") or "1.2.0" load(pathJoin("hpc", hpc_ver)) @@ -22,7 +22,7 @@ load(pathJoin("bacio", bacio_ver)) g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" +ip_ver=os.getenv("ip_ver") or "4.0.0" load(pathJoin("ip", ip_ver)) nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" From 5fbfa1fc2a4fb045670cb3815eb82a8e83a29cac Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Tue, 29 Nov 2022 14:19:57 +0000 Subject: [PATCH 10/12] Point to Hang's ip v4.0 version of Cactus. Fixes #242. --- modulefiles/build.wcoss2.intel.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.wcoss2.intel.lua b/modulefiles/build.wcoss2.intel.lua index 5e10b66c9..2140c8abe 100644 --- a/modulefiles/build.wcoss2.intel.lua +++ b/modulefiles/build.wcoss2.intel.lua @@ -51,8 +51,6 @@ load(pathJoin("sigio", sigio_ver)) sp_ver=os.getenv("sp_ver") or "2.3.3" load(pathJoin("sp", sp_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" -load(pathJoin("ip", ip_ver)) -- setenv("ip_DIR","/lfs/h2/emc/global/noscrub/George.Gayno/ip.git/lib64/cmake/ip") g2_ver=os.getenv("g2_ver") or "3.4.5" @@ -77,4 +75,8 @@ prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304 esmf_ver=os.getenv("esmf_ver") or "8.2.1b04" load(pathJoin("esmf", esmf_ver)) +prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.9") +ip_ver=os.getenv("ip_ver") or "4.0.0" +load(pathJoin("ip", ip_ver)) + whatis("Description: UFS_UTILS build environment") From b2696d939c823fe028e9d1b33ecea0cc3c7ad088 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 8 Feb 2023 16:37:15 +0000 Subject: [PATCH 11/12] Point to new EPIC hpc stack and use ip 4.0.0 on Jet. Fixes #242. --- modulefiles/build.jet.intel.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.jet.intel.lua b/modulefiles/build.jet.intel.lua index bc716c79d..d6a0a877b 100644 --- a/modulefiles/build.jet.intel.lua +++ b/modulefiles/build.jet.intel.lua @@ -8,7 +8,7 @@ load(pathJoin("cmake", cmake_ver)) hpss_ver=os.getenv("hpss_ver") or "" load(pathJoin("hpss", hpss_ver)) -prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/nwprod/hpc-stack/libs/modulefiles/stack") +prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/role.epic/hpc-stack/libs/intel-2022.1.2/modulefiles/stack") hpc_ver=os.getenv("hpc_ver") or "1.2.0" load(pathJoin("hpc", hpc_ver)) @@ -37,7 +37,7 @@ load(pathJoin("w3nco", w3nco_ver)) sp_ver=os.getenv("sp_ver") or "2.3.3" load(pathJoin("sp", sp_ver)) -ip_ver=os.getenv("ip_ver") or "3.3.3" +ip_ver=os.getenv("ip_ver") or "4.0.0" load(pathJoin("ip", ip_ver)) bacio_ver=os.getenv("bacio_ver") or "2.4.1" From a682ce8347ff5eb15283e6e084b6a58289e484eb Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Tue, 21 Feb 2023 12:57:54 +0000 Subject: [PATCH 12/12] Point to official hpc stack version of ip v4.0.0 on WCOSS2. Fixes #242. --- modulefiles/build.wcoss2.intel.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modulefiles/build.wcoss2.intel.lua b/modulefiles/build.wcoss2.intel.lua index b59573712..1c8953c56 100644 --- a/modulefiles/build.wcoss2.intel.lua +++ b/modulefiles/build.wcoss2.intel.lua @@ -17,7 +17,6 @@ load(pathJoin("intel", intel_ver)) cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.7" load(pathJoin("cray-mpich", cray_mpich_ver)) - libjpeg_ver=os.getenv("libjpeg_ver") or "9c" load(pathJoin("libjpeg", libjpeg_ver)) @@ -51,7 +50,8 @@ load(pathJoin("sigio", sigio_ver)) sp_ver=os.getenv("sp_ver") or "2.3.3" load(pathJoin("sp", sp_ver)) --- setenv("ip_DIR","/lfs/h2/emc/global/noscrub/George.Gayno/ip.git/lib64/cmake/ip") +ip_ver=os.getenv("ip_ver") or "4.0.0" +load(pathJoin("ip", ip_ver)) g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) @@ -75,8 +75,4 @@ prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304 esmf_ver=os.getenv("esmf_ver") or "8.4.0b08" load(pathJoin("esmf", esmf_ver)) -prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.9") -ip_ver=os.getenv("ip_ver") or "4.0.0" -load(pathJoin("ip", ip_ver)) - whatis("Description: UFS_UTILS build environment")