Skip to content
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions GEOS_LdasGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
36 changes: 18 additions & 18 deletions GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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) )
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 6 additions & 3 deletions GEOSldas_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions GEOSldas_App/preprocess_ldas_routines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions LDAS_Shared/LDAS_TileCoordRoutines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand Down Expand Up @@ -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, &
Expand Down Expand Up @@ -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
Expand Down