diff --git a/CHANGELOG.md b/CHANGELOG.md index 858cbfd0..5703e81f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,13 +18,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Switch to using EASE grid tools in MAPL. - Specify only ntasks_model for SLURM resource request. - Revisions for handling of Nens and special nml and mwtrm path/files in coupled land-atm DAS. - Updated some defaults in LDASsa_DEFAULT_inputs_*.nml files. ### Fixed -- Fixed error from MAPL's ApplicationSupport.F90 to init UDUNITS +- Fixed error from MAPL's ApplicationSupport.F90 to init UDUNITS. ### Removed diff --git a/GEOS_LdasGridComp.F90 b/GEOS_LdasGridComp.F90 index cf481aa1..3bf3025d 100644 --- a/GEOS_LdasGridComp.F90 +++ b/GEOS_LdasGridComp.F90 @@ -7,7 +7,7 @@ module GEOS_LdasGridCompMod ! !USES use ESMF - use MAPL_Mod + use MAPL use GEOS_MetforceGridCompMod, only: MetforceSetServices => SetServices use GEOS_LandGridCompMod, only: LandSetServices => SetServices @@ -16,7 +16,6 @@ module GEOS_LdasGridCompMod use GEOS_LandAssimGridCompMod, only: LandAssimSetServices => SetServices use GEOS_LandiceGridCompMod, only: LandiceSetServices => SetServices - use EASE_conv, only: ease_inverse use LDAS_TileCoordType, only: tile_coord_type , T_TILECOORD_STATE, TILECOORD_WRAP use LDAS_TileCoordType, only: grid_def_type, io_grid_def_type, operator (==) use LDAS_TileCoordRoutines, only: get_minExtent_grid, get_ij_ind_from_latlon, io_domain_files @@ -537,12 +536,12 @@ subroutine Initialize(gc, import, export, clock, rc) call ESMF_GRID_INTERIOR(agrid,I1,IN,J1,JN) do I = 1,size(centerX,1) - call ease_inverse(gridname,1.0*(I+I1-2),0.0,lat,lon) + call MAPL_ease_inverse(gridname,1.0*(I+I1-2),0.0,lat,lon) centerX(I,:) = lon * MAPL_DEGREES_TO_RADIANS enddo do J = 1,size(centerY,2) - call ease_inverse(gridname,0.0,1.0*(J+J1-2),lat,lon) + call MAPL_ease_inverse(gridname,0.0,1.0*(J+J1-2),lat,lon) centerY(:,J) = lat * MAPL_DEGREES_TO_RADIANS enddo diff --git a/GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90 b/GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90 index eedd28c8..b304ac01 100644 --- a/GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90 +++ b/GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90 @@ -74,8 +74,8 @@ module clsm_ensupd_enkf_update use nr_ran2_gasdev, ONLY: & NRANDSEED - use ease_conv, ONLY: & - ease_convert + use MAPL, ONLY: & + MAPL_ease_convert use my_matrix_functions, ONLY: & row_std @@ -2235,7 +2235,7 @@ subroutine write_smapL4SMaup( option, date_time, exp_id, N_ens, & ) if (index(tile_grid_g%gridtype, 'M09') /=0) then - call ease_convert(trim(tile_grid_g%gridtype), this_lat, this_lon, col_ind, row_ind) + call MAPL_ease_convert(trim(tile_grid_g%gridtype), this_lat, this_lon, col_ind, row_ind) endif ! col_ind and row_ind are zero-based, need one-based index here @@ -2254,7 +2254,7 @@ subroutine write_smapL4SMaup( option, date_time, exp_id, N_ens, & ) if (index(tile_grid_g%gridtype, 'M09') /=0) then - call ease_convert(trim(tile_grid_g%gridtype), this_lat, this_lon, col_ind, row_ind) + call MAPL_ease_convert(trim(tile_grid_g%gridtype), this_lat, this_lon, col_ind, row_ind) endif ! col_ind and row_ind are zero-based, need one-based index here @@ -2278,7 +2278,7 @@ subroutine write_smapL4SMaup( option, date_time, exp_id, N_ens, & if (index(tile_grid_g%gridtype, 'M09') /=0) then ! subindex (1:7) to get the string EASEvx_ gridname_tmp = tile_grid_g%gridtype(1:7)//'M36' - call ease_convert(gridname_tmp, this_lat, this_lon, col_ind, row_ind) + call MAPL_ease_convert(gridname_tmp, this_lat, this_lon, col_ind, row_ind) endif ! col_ind and row_ind are zero-based, need one-based index here diff --git a/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 b/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 index 22ab792d..67aa07fe 100644 --- a/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 +++ b/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 @@ -25,9 +25,9 @@ module clsm_ensupd_read_obs use io_hdf5, ONLY: & hdf5read - use EASE_conv, ONLY: & - ease_convert, & - ease_extent + use MAPL, ONLY: & + MAPL_ease_convert, & + MAPL_ease_extent use LDAS_ensdrv_globals, ONLY: & logit, & @@ -5542,12 +5542,12 @@ subroutine read_obs_SMOS( date_time, N_catd, this_obs_param, & if (tmp_tile_num(ii)>0) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & tile_coord(tmp_tile_num(ii))%com_lat, & tile_coord(tmp_tile_num(ii))%com_lon, & M36_col_ind_tile, M36_row_ind_tile ) - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & tmp_lat(ii), & tmp_lon(ii), & M36_col_ind_obs, M36_row_ind_obs ) @@ -7159,12 +7159,12 @@ subroutine read_obs_SMAP_FT( date_time, N_catd, this_obs_param, & if (tmp_tile_num(ii)>0) then - call ease_convert('EASEv2_M09', & + call MAPL_ease_convert('EASEv2_M09', & tile_coord(tmp_tile_num(ii))%com_lat, & tile_coord(tmp_tile_num(ii))%com_lon, & M09_col_ind_tile, M09_row_ind_tile ) - call ease_convert('EASEv2_M09', & + call MAPL_ease_convert('EASEv2_M09', & tmp_lat(ii), & tmp_lon(ii), & M09_col_ind_obs, M09_row_ind_obs ) @@ -8229,12 +8229,12 @@ subroutine read_obs_SMAP_halforbit_Tb( date_time, N_catd, this_obs_param, & if (tmp_tile_num(ii)>0) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & tile_coord(tmp_tile_num(ii))%com_lat, & tile_coord(tmp_tile_num(ii))%com_lon, & M36_col_ind_tile, M36_row_ind_tile ) - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & tmp_lat(ii), & tmp_lon(ii), & M36_col_ind_obs, M36_row_ind_obs ) @@ -8529,7 +8529,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation ! ! assemble 36 km EASEv2 mask of L2AP_Tb obs - call ease_extent( 'EASEv2_M36', N_cols, N_rows ) + call MAPL_ease_extent( 'EASEv2_M36', N_cols, N_rows ) allocate( mask_h_A(N_cols,N_rows) ) allocate( mask_h_D(N_cols,N_rows) ) @@ -8551,7 +8551,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_f(ii)%species==species_L2AP_Tbh_A) then - call ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & + call MAPL_ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & col, row) ! set mask=.true. for the M36 grid cell that contains the L2AP_Tb obs; @@ -8573,7 +8573,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_f(ii)%species==species_L2AP_Tbh_D) then - call ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & + call MAPL_ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & col, row) ! set mask=.true. for the M36 grid cell that contains the L2AP_Tb obs; @@ -8595,7 +8595,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_f(ii)%species==species_L2AP_Tbv_A) then - call ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & + call MAPL_ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & col, row) ! set mask=.true. for the M36 grid cell that contains the L2AP_Tb obs; @@ -8617,7 +8617,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_f(ii)%species==species_L2AP_Tbv_D) then - call ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & + call MAPL_ease_convert('EASEv2_M36', Observations_f(ii)%lat, Observations_f(ii)%lon, & col, row) ! set mask=.true. for the M36 grid cell that contains the L2AP_Tb obs; @@ -8652,7 +8652,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_l(ii)%species==species_L1C_Tbh_A) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & Observations_l(ii)%lat, Observations_l(ii)%lon, col, row) ! note conversion to one-based indices @@ -8671,7 +8671,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_l(ii)%species==species_L1C_Tbh_D) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & Observations_l(ii)%lat, Observations_l(ii)%lon, col, row) ! note conversion to one-based indices @@ -8692,7 +8692,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_l(ii)%species==species_L1C_Tbv_A) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & Observations_l(ii)%lat, Observations_l(ii)%lon, col, row) ! note conversion to one-based indices @@ -8711,7 +8711,7 @@ subroutine turn_off_assim_SMAP_L1CTb(N_obs_param, obs_param, N_obsl, Observation if (Observations_l(ii)%species==species_L1C_Tbv_D) then - call ease_convert('EASEv2_M36', & + call MAPL_ease_convert('EASEv2_M36', & Observations_l(ii)%lat, Observations_l(ii)%lon, col, row) ! note conversion to one-based indices diff --git a/GEOSldas_App/ldas_setup b/GEOSldas_App/ldas_setup index 1e795ce6..c8d69b5c 100755 --- a/GEOSldas_App/ldas_setup +++ b/GEOSldas_App/ldas_setup @@ -463,12 +463,15 @@ class LDASsetup: extension = os.path.splitext(tmptile)[1] if extension == '.domain': extension = os.path.splitext(tmptile)[0] - + gridname_ ='' if extension == '.til': - self.rqdExeInp['GRIDNAME'] = linecache.getline(tmptile, 3).strip() + gridname_ = linecache.getline(tmptile, 3).strip() else: nc_file = netCDF4.Dataset(tmptile,'r') - self.rqdExeInp['GRIDNAME'] = nc_file.getncattr('Grid_Name') + gridname_ = nc_file.getncattr('Grid_Name') + # in case it is an old name: SMAP-EASEvx-Mxx + gridname_ = gridname_.replace('SMAP-','').replace('-M','_M') + self.rqdExeInp['GRIDNAME'] = gridname_ if 'LSM_CHOICE' not in self.rqdExeInp: self.rqdExeInp['LSM_CHOICE'] = 1 diff --git a/GEOSldas_App/preprocess_ldas_routines.F90 b/GEOSldas_App/preprocess_ldas_routines.F90 index 382a549d..738bbe06 100644 --- a/GEOSldas_App/preprocess_ldas_routines.F90 +++ b/GEOSldas_App/preprocess_ldas_routines.F90 @@ -2402,11 +2402,17 @@ subroutine optimize_latlon(fname_tilefile, N_proc_string, optimized_file, run_di call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) end if + if (index(gridname, 'SMAP') /=0 ) then + gridname = trim(adjustl(gridname)) + gridname = gridname(6:) + gridname(7:7) = '_' ! replace '-' with '_' + endif + open(10,file=optimized_file, action='write') - write(10,'(A)') "GEOSldas.GRID_TYPE: LatLon" + write(10,'(A)') "GEOSldas.GRID_TYPE: EASE" write(10,'(A)') "GEOSldas.GRIDNAME: "//trim(gridname) write(10,'(A)') "GEOSldas.LM: 1" - write(10,'(A)') "GEOSldas.POLE: PE" + write(10,'(A)') "GEOSldas.POLE: XY" write(10,'(A)') "GEOSldas.DATELINE: DE" write(10,'(A,I6)') "GEOSldas.IM_WORLD: ", N_lon write(10,'(A,I6)') "GEOSldas.JM_WORLD: ", N_lat diff --git a/LDAS_Shared/LDAS_TileCoordRoutines.F90 b/LDAS_Shared/LDAS_TileCoordRoutines.F90 index 7ddd5b55..43e5f86b 100644 --- a/LDAS_Shared/LDAS_TileCoordRoutines.F90 +++ b/LDAS_Shared/LDAS_TileCoordRoutines.F90 @@ -26,10 +26,9 @@ module LDAS_TileCoordRoutines use MAPL_ConstantsMod, ONLY: & MAPL_RADIUS ! Earth radius - use EASE_conv, ONLY: & - ease_convert, & - ease_inverse, & - ease_extent + use MAPL, ONLY: & + MAPL_ease_convert, & + MAPL_ease_extent use LDAS_ExceptionsMod, ONLY: & ldas_abort, & @@ -380,7 +379,7 @@ subroutine LDAS_create_grid_g( gridname, n_lon, n_lat, & tile_grid%i_dir = +1 tile_grid%j_dir = -1 - call ease_extent ( & + call MAPL_ease_extent ( & gridname, cols, rows, & cell_area = ease_cell_area, & ! [m^2] ll_lon = tile_grid%ll_lon, & @@ -1002,7 +1001,7 @@ subroutine get_ij_ind_from_latlon( tile_grid, lat, lon, i_ind, j_ind ) ! EASE grid lat/lon to index provides *global*, *0-based* index! - call ease_convert(tile_grid%gridtype, lat, lon, r, s) + call MAPL_ease_convert(tile_grid%gridtype, lat, lon, r, s) i_indg = nint(r) ! i_ind or lon_ind j_indg = nint(s) ! j_ind or lat_ind