From 01f63b733a82dc764251e942a1f53da07e6c09aa Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 25 Mar 2024 14:34:25 -0400 Subject: [PATCH] Move LDAS_App to GEOSldas_App under GEOSldas_GridComp --- doc/README.ConfigurationFiles.md | 20 +- doc/README.OutputSpecs.md | 32 +- src/Applications/CMakeLists.txt | 1 - src/CMakeLists.txt | 1 - .../GEOSldas_GridComp/CMakeLists.txt | 4 +- .../GEOSlandassim_GridComp/mwRTM_routines.F90 | 606 +++++++++--------- .../GEOSlandassim_GridComp/mwRTM_types.F90 | 278 ++++---- .../GEOSldas_App}/CMakeLists.txt | 0 .../GEOSldas_App}/GEOSldas.F90 | 0 .../GEOSldas_App}/GEOSldas_CAP.rc | 0 .../GEOSldas_App}/GEOSldas_ExtData.rc | 0 .../GEOSldas_App}/GEOSldas_HIST.rc | 0 .../GEOSldas_App}/GEOSldas_LDAS.rc | 0 .../LDASsa_DEFAULT_inputs_adapt.nml | 0 .../LDASsa_DEFAULT_inputs_catbias.nml | 0 .../LDASsa_DEFAULT_inputs_ensprop.nml | 0 .../LDASsa_DEFAULT_inputs_ensupd.nml | 0 .../GEOSldas_App}/README_LDAS_App | 22 +- .../ens_forcing/average_ensemble_forcing.py | 0 .../GEOSldas_App}/ens_forcing/enpert_forc.csh | 0 .../ens_forcing/ensemble_forc.py | 0 .../GEOSldas_App}/ens_forcing/regrid_forc.csh | 0 .../ens_forcing/test_enpert_forc.j | 0 .../GEOSldas_App}/ldas_setup | 0 .../GEOSldas_App}/lenkf.j.template | 0 .../GEOSldas_App}/preprocess_ldas.F90 | 0 .../preprocess_ldas_routines.F90 | 0 .../GEOSldas_App}/process_hist.csh | 0 .../GEOSldas_App}/remap_config_ldas.py | 0 .../LADAS/HISTORY.rc.atmens | 10 +- .../LADAS/HISTORY.rc.central | 0 .../LADAS/exeinp.txt.Hy4dEnVar.atmens | 0 .../LADAS/exeinp.txt.Hy4dEnVar.central | 0 .../GEOSldas_App}/tile_bin2nc4.F90 | 0 .../config/Create_ccorr_cat_progn_default.m | 0 .../util/config/generate_catchincr_hist.py | 24 +- .../util/config/rewind_GEOSldas.csh | 0 .../util/inputs/ASCAT_sm_mask/CMakeLists.txt | 0 .../inputs/ASCAT_sm_mask/ascat_mask_maker.F90 | 0 .../mwRTM_params/Create_mwRTM_param_file.m | 64 +- .../Create_vegopacity_8day_clim.m | 124 ++-- ...reprocess_L2DCA_mwRTM_params_to_dailymat.m | 106 +-- .../mwRTM_params/fill_gaps_in_tiledata.m | 0 .../get_L2_RTM_constants_tile_data.m | 0 .../inputs/mwRTM_params/get_mwRTM_lookup.m | 0 .../mwRTM_params/get_mwRTM_vegcls_based.m | 0 .../inputs/mwRTM_params/mwrtm_bin2nc4.F90 | 0 .../Run_get_L4_Tb_scale_SMAP.m | 58 +- ...get_model_and_obs_clim_stats_latlon_grid.m | 10 +- .../inputs/obs_scaling_params/dist_km2deg.m | 0 .../get_ij_ind_from_latlon.m | 0 .../get_model_and_obs_clim_stats.m | 0 ...get_model_and_obs_clim_stats_latlon_grid.m | 0 .../obs_scaling_params/get_tile_num_for_obs.m | 0 .../get_tile_num_in_cell_ij.m | 0 .../write_netcdf_latlon_grid.m | 0 .../obs_scaling_params/write_seqbin_file.m | 0 .../util/postproc/climatology/README | 0 .../climatology/Run_L4_sm_clim_stats.m | 0 .../Write_L4_sm_clim_stat_bin2nc4.m | 0 .../climatology/get_model_clim_stats.m | 0 .../climatology/read_seqbin_clim_pctl_file.m | 0 .../climatology/write_seqbin_clim_pctl_file.m | 0 .../util/postproc/compress_bit-shaved_nc4.sh | 0 .../util/postproc/write_smapL4SMqa.m | 268 ++++---- .../util/shared/matlab/EASEv2_ind2latlon.m | 0 .../util/shared/matlab/EASEv2_latlon2ind.m | 0 .../util/shared/matlab/J2000_to_DateTime.m | 0 .../shared/matlab/MAPL_ReadForcing_fullfile.m | 0 .../util/shared/matlab/augment_date_time.m | 0 .../util/shared/matlab/days_in_month.m | 0 .../util/shared/matlab/get_dofyr_pentad.m | 0 .../util/shared/matlab/is_leap_year.m | 0 .../util/shared/matlab/pentad_of_year.m | 0 .../util/shared/matlab/read_ObsFcstAna.m | 0 .../util/shared/matlab/read_catparam.m | 0 .../util/shared/matlab/read_obslog.m | 0 .../util/shared/matlab/read_obsparam.m | 0 .../util/shared/matlab/read_smapL4SMaup.m | 0 .../util/shared/matlab/read_smapL4SMlmc.m | 0 .../util/shared/matlab/read_tilecoord.m | 0 .../util/shared/matlab/read_tilegrids.m | 0 .../util/shared/matlab/tile2grid.m | 0 83 files changed, 814 insertions(+), 814 deletions(-) delete mode 100644 src/Applications/CMakeLists.txt rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/CMakeLists.txt (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/GEOSldas.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/GEOSldas_CAP.rc (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/GEOSldas_ExtData.rc (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/GEOSldas_HIST.rc (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/GEOSldas_LDAS.rc (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/LDASsa_DEFAULT_inputs_adapt.nml (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/LDASsa_DEFAULT_inputs_catbias.nml (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/LDASsa_DEFAULT_inputs_ensprop.nml (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/LDASsa_DEFAULT_inputs_ensupd.nml (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/README_LDAS_App (56%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ens_forcing/average_ensemble_forcing.py (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ens_forcing/enpert_forc.csh (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ens_forcing/ensemble_forc.py (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ens_forcing/regrid_forc.csh (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ens_forcing/test_enpert_forc.j (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/ldas_setup (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/lenkf.j.template (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/preprocess_ldas.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/preprocess_ldas_routines.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/process_hist.csh (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/remap_config_ldas.py (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/sample_config_files/LADAS/HISTORY.rc.atmens (99%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/sample_config_files/LADAS/HISTORY.rc.central (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.atmens (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.central (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/tile_bin2nc4.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/config/Create_ccorr_cat_progn_default.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/config/generate_catchincr_hist.py (89%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/config/rewind_GEOSldas.csh (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/ASCAT_sm_mask/CMakeLists.txt (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/ASCAT_sm_mask/ascat_mask_maker.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/Create_mwRTM_param_file.m (93%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m (93%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m (89%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/fill_gaps_in_tiledata.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/get_L2_RTM_constants_tile_data.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/get_mwRTM_lookup.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/get_mwRTM_vegcls_based.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/mwRTM_params/mwrtm_bin2nc4.F90 (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m (90%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m (98%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/dist_km2deg.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/get_ij_ind_from_latlon.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats_latlon_grid.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/get_tile_num_for_obs.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/get_tile_num_in_cell_ij.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/write_netcdf_latlon_grid.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/inputs/obs_scaling_params/write_seqbin_file.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/README (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/Run_L4_sm_clim_stats.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/Write_L4_sm_clim_stat_bin2nc4.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/get_model_clim_stats.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/read_seqbin_clim_pctl_file.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/climatology/write_seqbin_clim_pctl_file.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/compress_bit-shaved_nc4.sh (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/postproc/write_smapL4SMqa.m (95%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/EASEv2_ind2latlon.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/EASEv2_latlon2ind.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/J2000_to_DateTime.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/MAPL_ReadForcing_fullfile.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/augment_date_time.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/days_in_month.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/get_dofyr_pentad.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/is_leap_year.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/pentad_of_year.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_ObsFcstAna.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_catparam.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_obslog.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_obsparam.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_smapL4SMaup.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_smapL4SMlmc.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_tilecoord.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/read_tilegrids.m (100%) rename src/{Applications/LDAS_App => Components/GEOSldas_GridComp/GEOSldas_App}/util/shared/matlab/tile2grid.m (100%) diff --git a/doc/README.ConfigurationFiles.md b/doc/README.ConfigurationFiles.md index bfa29754..b84b64e9 100644 --- a/doc/README.ConfigurationFiles.md +++ b/doc/README.ConfigurationFiles.md @@ -1,32 +1,32 @@ # GEOSldas Configuration Files -This document describes the files involved in the specification and pre-processing of the GEOSldas configuration parameters. +This document describes the files involved in the specification and pre-processing of the GEOSldas configuration parameters. Note that the values of the configuration parameters that are used during the execution of `GEOSldas.x` are written into the GEOSldas log file (`./output/*/rc_out/Y*/M*/*.ldas_log.*.txt`). --- ### `"exeinp"` and `"batinp"` files -Inputs to `ldas_setup` that contain user-defined configuration information. +Inputs to `ldas_setup` that contain user-defined configuration information. -Use `ldas_setup` to create sample files that contain descriptions of the configuration parameters. +Use `ldas_setup` to create sample files that contain descriptions of the configuration parameters. For details, see [README.md](https://github.com/GEOS-ESM/GEOSldas/blob/main/README.md). --- ### `LDASsa_SPECIAL_inputs_*.nml` - -Optional Fortran namelist (nml) files that contain additional user-defined configuration information for ensemble perturbations and data assimilation. -The path to these nml files is specified in the `"exeinp"` file. +Optional Fortran namelist (nml) files that contain additional user-defined configuration information for ensemble perturbations and data assimilation. -During `ldas_setup`, **default** configuration files (`LDASsa_DEFAULT_inputs_*.nml`) are created in the experiment `./run` directory. These files contain a complete set of the available configuration parameters with descriptions. The default configuration is a single-member land model simulation without perturbations and without data assimilation. The "DEFAULT" nml files must be present in the experiment `./run` directory and should not be edited. +The path to these nml files is specified in the `"exeinp"` file. + +During `ldas_setup`, **default** configuration files (`LDASsa_DEFAULT_inputs_*.nml`) are created in the experiment `./run` directory. These files contain a complete set of the available configuration parameters with descriptions. The default configuration is a single-member land model simulation without perturbations and without data assimilation. The "DEFAULT" nml files must be present in the experiment `./run` directory and should not be edited. To run GEOSldas with ensemble perturbations and data assimilation, users must create "SPECIAL" nml files (`LDASsa_SPECIAL_inputs_*.nml`) that contain the desired settings of the parameters. Only the nml parameters that are different from those in the "DEFAULT" files need to be included in the "SPECIAL" nml files. Parameters are grouped into three separate nml files: -* `ensprop` : Perturbations applied during the land model ensemble propagation step. +* `ensprop` : Perturbations applied during the land model ensemble propagation step. * `ensupd` : Assimilated observations and parameters of the ensemble-based analysis. * `catbias` : Dynamic bias estimation (defunct). @@ -50,11 +50,11 @@ If an experiment did not complete successfully (e.g., because of a system downti Contains parameters needed to run the main GEOSldas executable (`GEOSldas.x`), including information on land model configuration, version, grid, time steps, processor layout. -Created in the experiment `./run` directory during `ldas_setup`. Merges information from the `"exeinp"` and `"batinp"` files and the resource parameter template files for GEOSldas, i.e., [GEOSldas_LDAS.rc](https://github.com/GEOS-ESM/GEOSldas/blob/main/src/Applications/LDAS_App/GEOSldas_LDAS.rc) and [GEOS_SurfaceGridComp.rc](https://github.com/GEOS-ESM/GEOSgcm_GridComp/blob/main/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/GEOS_SurfaceGridComp.rc) (from the linked GEOSgcm_GridComp repository). +Created in the experiment `./run` directory during `ldas_setup`. Merges information from the `"exeinp"` and `"batinp"` files and the resource parameter template files for GEOSldas, i.e., [GEOSldas_LDAS.rc](https://github.com/GEOS-ESM/GEOSldas/blob/main/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_LDAS.rc) and [GEOS_SurfaceGridComp.rc](https://github.com/GEOS-ESM/GEOSgcm_GridComp/blob/main/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/GEOS_SurfaceGridComp.rc) (from the linked GEOSgcm_GridComp repository). **Users are generally discouraged from editing** `LDAS.rc`. For example, editing `MET_PATH` does not change the associated directory link. Instead, users should run `ldas_setup` to create `LDAS.rc`. -`LDAS.rc` can be useful as a compact overview of the experiment configuration. +`LDAS.rc` can be useful as a compact overview of the experiment configuration. --- ### `lenkf.j` diff --git a/doc/README.OutputSpecs.md b/doc/README.OutputSpecs.md index 05338171..c985b9b5 100644 --- a/doc/README.OutputSpecs.md +++ b/doc/README.OutputSpecs.md @@ -7,26 +7,26 @@ Most diagnostic output from GEOSldas is generated through the **HISTORY** functi Restart/checkpoint files are also written through MAPL (although not through HISTORY). The key configuration parameters that control checkpoint file output are described in the sample "exeinp" files that can be generated using `ldas_setup`. For details, see [README.md](https://github.com/GEOS-ESM/GEOSldas/blob/main/README.md). Notable exceptions from the MAPL-generated output include: -* log files [ASCII], +* log files [ASCII], * observation-space "ObsFcstAna" data assimilation diagnostics [BINARY], and * SMAP L4_SM-specific "aup" data assimilation diagnostics files (available _**only**_ for simulations in EASEv2_M09 tile space) [BINARY]. -Output of the latter two sets of files can be turned on/off in the `[NML_INPUT_PATH]/LDASsa_SPECIAL_inputs_ensupd.nml` configuration file, and Matlab readers are available in the -[src/Applications/LDAS_App/util](https://github.com/GEOS-ESM/GEOSldas/tree/main/src/Applications/LDAS_App/util) directory. +Output of the latter two sets of files can be turned on/off in the `[NML_INPUT_PATH]/LDASsa_SPECIAL_inputs_ensupd.nml` configuration file, and Matlab readers are available in the +[src/Components/GEOSldas_GridComp/GEOSldas_App/util](https://github.com/GEOS-ESM/GEOSldas/tree/main/src/Components/GEOSldas_GridComp/GEOSldas_App/util) directory. ### MAPL HISTORY output -As part of `ldas_setup`, a sample `HISTORY.rc` configuration file is created in the experiment's `./run` directory. Users specify the desired output by editing `HISTORY.rc`. +As part of `ldas_setup`, a sample `HISTORY.rc` configuration file is created in the experiment's `./run` directory. Users specify the desired output by editing `HISTORY.rc`. `HISTORY.rc` defines a number of output file "Collections", each of which contains one or more output variables. Output can be in the native tile space ("1d") or gridded ("2d"), _**except**_ when the simulation is in the EASE grid tile space (see below). All variables contained in a given Collection are written: -* on the same ("2d") grid (if gridded), -* at the same frequency, and -* with either time-average ("tavg") or instantaneous ("inst") sampling mode. +* on the same ("2d") grid (if gridded), +* at the same frequency, and +* with either time-average ("tavg") or instantaneous ("inst") sampling mode. -In the following example, two Collections are written. The `tavg3_2d_lnd_Nx` Collection contains time-average ("tavg"), 3-hourly ("3"), gridded ("2d") data, and the `inst1_1d_lfs_Nt` Collection contains snapshot/instantaneous ("inst"), 1-hourly, tile-space ("1d") data. +In the following example, two Collections are written. The `tavg3_2d_lnd_Nx` Collection contains time-average ("tavg"), 3-hourly ("3"), gridded ("2d") data, and the `inst1_1d_lfs_Nt` Collection contains snapshot/instantaneous ("inst"), 1-hourly, tile-space ("1d") data. ``` COLLECTIONS: 'tavg3_2d_lnd_Nx' @@ -46,12 +46,12 @@ For example, to write 3-hourly, time-average output of the "WCSF" and "WCRZ" var :: ``` -To be available for output through MAPL HISTORY, a variable ("field") must be defined as an `ExportSpec` in a `GEOS_*GridComp.F90` file. The list of variables ("fields") in the definition of each Collection consists of three columns: +To be available for output through MAPL HISTORY, a variable ("field") must be defined as an `ExportSpec` in a `GEOS_*GridComp.F90` file. The list of variables ("fields") in the definition of each Collection consists of three columns: - (column 1) variable name in `GEOS_[GCNAME]GridComp.F90` file, -- (column 2) GridComp name [GCNAME], and +- (column 2) GridComp name [GCNAME], and - (column 3) user-specified variable name that appears in nc4 output (optional). -The same variable can be written in more than one Collection (i.e., at the same or different temporal and/or spatial resolutions), and there is no limit to the number of Collections that are defined for and written by a simulation. +The same variable can be written in more than one Collection (i.e., at the same or different temporal and/or spatial resolutions), and there is no limit to the number of Collections that are defined for and written by a simulation. Gridded ("2d") output can be on a grid other than the "native" grid that is associated with the tile space used in the simulation, as long as the output grid is defined in `HISTORY.rc`. For example, if the simulation uses a cube-sphere tile space, the 1/2-degree lat/lon output grid mentioned above would be defined as follows: ``` @@ -71,20 +71,20 @@ MAPL HISTORY can generally write gridded ("2d") output in binary or netcdf-4 (nc **Special considerations for GEOSldas** -1. Gridded ("2d") output _**cannot**_ be written for simulations in any EASE-grid tile space. But since each EASE-grid cell contains at most one tile, it is straightforward to convert tile-space ("1d") output into gridded output (2d arrays) on the fly using the `i_indg` and `j_indg` data in the `./rc_out/*tilecoord*` file. See Matlab readers and scripts in `./src/Application/LDAS_App/util`. +1. Gridded ("2d") output _**cannot**_ be written for simulations in any EASE-grid tile space. But since each EASE-grid cell contains at most one tile, it is straightforward to convert tile-space ("1d") output into gridded output (2d arrays) on the fly using the `i_indg` and `j_indg` data in the `./rc_out/*tilecoord*` file. See Matlab readers and scripts in `./src/Components/GEOSldas_GridComp/GEOSldas_App/util`. -2. When running in EASE-grid tile space, the main GEOSldas executable (`GEOSldas.x`) first writes tile-space ("1d") output in binary format using MAPL HISTORY. If nc4 output is requested in `HISTORY.rc`, the binary output from `GEOSldas.x` is then automatically converted into nc4 format in post-processing as part of the `lenkf.j` job script using the `tile_bin2nc4.F90` utility. +2. When running in EASE-grid tile space, the main GEOSldas executable (`GEOSldas.x`) first writes tile-space ("1d") output in binary format using MAPL HISTORY. If nc4 output is requested in `HISTORY.rc`, the binary output from `GEOSldas.x` is then automatically converted into nc4 format in post-processing as part of the `lenkf.j` job script using the `tile_bin2nc4.F90` utility. -3. GEOSldas can bundle sub-daily nc4 output into daily nc4 files and write monthly-average output through the `POSTPROC_HIST` configuration option. +3. GEOSldas can bundle sub-daily nc4 output into daily nc4 files and write monthly-average output through the `POSTPROC_HIST` configuration option. **Enhanced file compression and bit shaving** -To save disk space, MAPL can facilitate enhanced file compression through the modification of scientifically meaningless information in the output files. The `\*.nbits` parameter specifies the number of bits retained: +To save disk space, MAPL can facilitate enhanced file compression through the modification of scientifically meaningless information in the output files. The `\*.nbits` parameter specifies the number of bits retained: ``` tavg3_2d_lnd_Nx.nbits: 12, ``` -Many MERRA-2 and FP products, for example, use `\*.nbits: 12` and `\*.nbits: 10`, respectively. +Many MERRA-2 and FP products, for example, use `\*.nbits: 12` and `\*.nbits: 10`, respectively. To realize the disk space savings, bit-shaved output **must be compressed separately** after the simulation has finished. Binary files can be compressed with `gzip`; nc4 files can be compressed using the `compress_bit-shaved_nc4.sh` utility script. For reasons of efficiency, the compression is not included in GEOSldas `POSTPROC_HIST`. diff --git a/src/Applications/CMakeLists.txt b/src/Applications/CMakeLists.txt deleted file mode 100644 index 0b6508c1..00000000 --- a/src/Applications/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory (LDAS_App) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 938bb668..6c5e032a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ add_subdirectory (Shared) add_subdirectory (Components) -add_subdirectory (Applications) diff --git a/src/Components/GEOSldas_GridComp/CMakeLists.txt b/src/Components/GEOSldas_GridComp/CMakeLists.txt index d6a7018a..b4c0974e 100644 --- a/src/Components/GEOSldas_GridComp/CMakeLists.txt +++ b/src/Components/GEOSldas_GridComp/CMakeLists.txt @@ -1,6 +1,6 @@ esma_set_this () -esma_add_subdirectory(GEOSgcm_GridComp ) +esma_add_subdirectory(GEOSgcm_GridComp) set (alldirs GEOSmetforce_GridComp @@ -15,3 +15,5 @@ esma_add_library(${this} SUBDIRS LDAS_Shared DEPENDENCIES GEOSland_GridComp makebcs MAPL INCLUDES ${INC_ESMF}) + +esma_add_subdirectory(GEOSldas_App) diff --git a/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_routines.F90 b/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_routines.F90 index 8a2fc5b6..45decf32 100644 --- a/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_routines.F90 +++ b/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_routines.F90 @@ -3,11 +3,11 @@ module mwRTM_routines ! subroutines for microwave radiative transfer model ! - ! Select a specific configuration of the RTM via the field - ! "RTM_ID" in the "obs_param" type. + ! Select a specific configuration of the RTM via the field + ! "RTM_ID" in the "obs_param" type. ! ! %RTM_ID = ID of radiative transfer model to use for Tb forward modeling - ! (subroutine get_obs_pred()) + ! (subroutine get_obs_pred()) ! 0 = none ! 1 = L-band tau-omega model as in De Lannoy et al. 2013 (doi:10.1175/JHM-D-12-092.1) (SMOS) ! 2 = same as 1 but without Pellarin atm corr (SMAP) @@ -22,12 +22,12 @@ module mwRTM_routines use MAPL_ConstantsMod, ONLY: & MAPL_PI, & MAPL_TICE - + use mwRTM_types, ONLY: & mwRTM_param_type, & mwRTM_param_nodata_check, & assignment (=) - + use LDAS_ensdrv_globals, ONLY: & logit, & logunit, & @@ -40,29 +40,29 @@ module mwRTM_routines LDAS_GENERIC_ERROR implicit none - + ! everything is private by default unless made public - + private - + public :: mwRTM_get_Tb, catch2mwRTM_vars - + ! --------------------------------------------------------- - + real, parameter :: Tb_sky = 2.7 ! cosmic mw background temp [K] complex, parameter :: diel_ice = (3.2, 0.1) ! dielec. const. of ice complex, parameter :: diel_air = (1.0, 0.0) ! dielec. const. of air complex, parameter :: diel_rock = (5.5, 0.2) ! dielec. const. of rock - + real, parameter :: diel_watinf = 4.9 ! dielec. const. of water @ high freq. ! (Stogryn 1971) - + real, parameter :: eps_0 = 8.854e-12 ! vacuum permittivity [Farads/meter] ! (Klein and Swift 1977) real, parameter :: rho_soil = 2.66 ! soil specific density [g/cm3] - + contains ! ********************************************************************** @@ -70,102 +70,102 @@ module mwRTM_routines ! Subroutine mwRTM_get_param() reads binary mwRTM files and is no longer used. ! ! The subroutine has been replaced by: - ! - Applications/LDAS_App/[..]/mwrtm_bin2nc4.F90 converts mwRTM files from binary to nc4 + ! - Components/GEOSldas_GridComp/GEOSldas_App/[..]/mwrtm_bin2nc4.F90 converts mwRTM files from binary to nc4 ! - get_mwrtm_param() in GEOS_LandAssimGridComp.F90 converts the internal state ! variables of the Land Assim GridComp into the mwRTM structure. ! ! reichle, 4 Aug 2020 - + ! subroutine mwRTM_get_param( N_catg, N_tile, d2g, tile_id, mwRTM_param_path, & ! need_mwRTM_param, mwp) -! +! ! ! Read microwave RTM parameters from file. ! ! -! ! reichle, 17 May 2011 +! ! reichle, 17 May 2011 ! ! reichle, 21 Oct 2011 - added input of mwRTM_param from file -! ! reichle, 23 Oct 2012 - removed look-up table option (too complicated with +! ! reichle, 23 Oct 2012 - removed look-up table option (too complicated with ! ! "new" (200+) soil classes) ! ! - added tile_id check when reading mwRTM params from file -! +! ! implicit none -! +! ! integer, intent(in) :: N_catg, N_tile -! +! ! integer, dimension(N_tile), intent(in) :: d2g, tile_id ! -! character(200), intent(in) :: mwRTM_param_path +! character(200), intent(in) :: mwRTM_param_path ! ! logical, intent(in) :: need_mwRTM_param ! ! type(mwRTM_param_type), dimension(N_tile), intent(out) :: mwp ! mwRTM parameters -! +! ! ! local variables -! +! ! integer, parameter :: N_search_dir_max = 5 -! +! ! integer :: n, N_search_dir, istat -! +! ! character( 80) :: fname -! +! ! character(100), dimension(N_search_dir_max) :: search_dir ! ! logical :: all_nodata, mwp_nodata -! +! ! character(len=*), parameter :: Iam = 'mwRTM_get_param' ! character(len=400) :: err_msg ! ! ! ---------------------------------------------------------------------- ! ! ! ! initialize -! +! ! do n=1,N_tile -! mwp(n) = nodata_generic +! mwp(n) = nodata_generic ! end do -! +! ! ! read mwRTM parameters from file -! +! ! if (logit) write (logunit,*) 'Reading microwave RTM parameters from file' -! +! ! fname = '/mwRTM_param.bin' -! +! ! N_search_dir = 2 ! specify sub-dirs of mwRTM_param_path to search for file "fname" -! +! ! search_dir(1) = 'mwRTM' ! search_dir(2) = '.' -! -! ! when called with optional argument "istat" subroutine "open_land_param_file()" -! ! will *NOT* stop upon failure to open the file -! +! +! ! when called with optional argument "istat" subroutine "open_land_param_file()" +! ! will *NOT* stop upon failure to open the file +! ! istat = open_land_param_file( 10, .false., .true., N_search_dir, fname, & ! mwRTM_param_path, search_dir, ignore_stop=.true.) -! +! ! if (istat==0) then -! +! ! call io_mwRTM_param_type( 'r', 10, N_tile, mwp, N_catg, tile_id, d2g ) -! +! ! close (10,status='keep') -! +! ! if (logit) write (logunit,*) 'done reading' ! if (logit) write (logunit,*) -! +! ! else -! +! ! if (logit) write (logunit,*) 'WARNING: Could not open file!' ! if (logit) write (logunit,*) -! +! ! end if -! +! ! ! check for no-data-values in parameters ! ! if any field is a nodata value, set all fields to nodata value ! ! all_nodata = .true. -! +! ! do n=1,N_tile -! +! ! call mwRTM_param_nodata_check( mwp(n), mwp_nodata ) -! +! ! if (.not. mwp_nodata) all_nodata = .false. -! +! ! end do ! ! ! stop if mwRTM parameters needed but not available (ie, all are no-data) @@ -178,7 +178,7 @@ module mwRTM_routines ! ! warn if mwRTM parameters are all no-data (may not be needed) ! ! if (all_nodata .and. logit) then -! +! ! write (logunit,*) '#########################################################' ! write (logunit,*) ! write (logunit,*) ' WARNING: *All* parameters for the microwave radiative ' @@ -188,47 +188,47 @@ module mwRTM_routines ! write (logunit,*) ! ! end if -! +! ! end subroutine mwRTM_get_param - + ! **************************************************************** subroutine catch2mwRTM_vars( N_tile, vegcls_catch, poros_catch, poros_mwRTM, & sfmc_catch, tsurf_catch, tp1_catch, sfmc_mwRTM, tsoil_mwRTM, tp1_in_Kelvin ) - + ! convert soil moisture, surface temperature, and soil temperature from the Catchment - ! model into soil moisture and soil temperature inputs for the microwave radiative - ! transfer model (mwRTM) + ! model into soil moisture and soil temperature inputs for the microwave radiative + ! transfer model (mwRTM) ! ! reichle, 11 Dec 2013 ! ! added optional switch to allow tp1_catch input in Kelvin ! - reichle & borescan, 6 Nov 2020 - + implicit none - + integer, intent(in) :: N_tile - + integer, dimension(N_tile), intent(in) :: vegcls_catch - + real, dimension(N_tile), intent(in) :: poros_catch, poros_mwRTM real, dimension(N_tile), intent(in) :: sfmc_catch, tsurf_catch, tp1_catch - + real, dimension(N_tile), intent(out) :: sfmc_mwRTM, tsoil_mwRTM logical, intent(in), optional :: tp1_in_Kelvin ! local variables - + logical :: tp1_in_K real, dimension(N_tile) :: tp1 - + ! ----------------------------------------------------------------------- ! ! reichle, 22 Oct 2012: scaling factor added because it is necessary for ! proper functioning of mwRTM calibration to SMOS obs - + sfmc_mwRTM = sfmc_catch * poros_mwRTM / poros_catch ! diagnose soil temperature to be used with mwRTM @@ -238,19 +238,19 @@ subroutine catch2mwRTM_vars( N_tile, vegcls_catch, poros_catch, poros_mwRTM, & ! NOTE: By default, "tp" is assumed to be in deg Celsius tp1_in_K = .false. - + if (present(tp1_in_Kelvin)) tp1_in_K = tp1_in_Kelvin tp1 = tp1_catch - + if (.not. tp1_in_K) tp1 = tp1 + MAPL_TICE ! convert units if not already in Kelvin - + tsoil_mwRTM = tp1 - + end subroutine catch2mwRTM_vars - + ! **************************************************************** - + subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & LAI, soilmoist, soiltemp, SWE, Tair, RTM_ID, Tb_h, Tb_v ) @@ -259,7 +259,7 @@ subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & !23 Nov 2010: - adapted to include the atmospheric correction ! GDL, code based on CMEMv3.0 ! - !Instead of passing on the whole diagnostic structure, + !Instead of passing on the whole diagnostic structure, !only pass rtmv, T5, Tc !GDL, 22Oct10 ! !N_cat could be either all tiles or only a part of them! @@ -268,12 +268,12 @@ subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & !FYI: !SM vol/vol ~ g/cm3 !gravim SM (g/g) * bulk densit (g/cm3) = volum SM (vol/vol) ~ g/cm3 - ! + ! !== VWC: Vegetation water content in kg/m2 (=mm) !== T5: Soil temperature [K] - !== Tc: Vegetation canopy temperature [K] + !== Tc: Vegetation canopy temperature [K] ! - !21 Mar 2011: - temperature treatment changed + !21 Mar 2011: - temperature treatment changed !==> instead of passing on T5 and Tc (= tsurf) !we now pass on tsurf and tp1 and diagnose T10cm (~T5) from it HERE !==> tsurf and tp1 are now input variables @@ -289,16 +289,16 @@ subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & ! 23 Nov 2011: - reichle: changed tsoil_threshold b/c QC now done for individual ! ensemble members ! 22 Oct 2012: - reichle: removed interception water ("capac") contribution - ! + ! !--------------------------------------------------- - + implicit none integer, intent(in) :: N_tile ! number of tiles real, intent(in) :: freq ! [Hz] real, intent(in) :: inc_angle ! [deg] - + type(mwRTM_param_type), dimension(N_tile), intent(in) :: mwp real, dimension(N_tile), intent(in) :: elev ! [m] @@ -310,82 +310,82 @@ subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & real, dimension(N_tile), intent(in) :: Tair ! [K] integer, intent(in) :: RTM_ID - + real, dimension(N_tile), intent(out) :: Tb_h, Tb_v ! [K] - + ! -------------------- - + ! local variables - + real, parameter :: tsoil_threshold = MAPL_TICE+0.2 ! avoid "frozen" soil [K] real, parameter :: SWE_threshold = 1.e-4 ! avoid snow [kg/m2] - + integer :: n - + real :: inc, sin_inc, cos_inc - complex :: c_er, tmpc1, tmpc2 + complex :: c_er, tmpc1, tmpc2 real :: roh, rov, rsh, rsv real :: h_mc, Q, slope - + real :: vwc, Ah, Av, exptauh, exptauv, exptauh2, exptauv2, tmpreal - + real :: exptau_atm, tau_atm, Tb_ad, Tb_au - + real :: soiltemp_in_C, Tc - + !real :: er_r ! for realdobson logical :: veg_params_nodata - + character(len=*), parameter :: Iam = 'mwRTM_get_Tb' character(len=400) :: err_msg - + !--------------------------------------------------- - + !if (logit) write(logunit,*) 'entering mwRTM_get_Tb...' ! check first element of elevation against no-data-value ! (elevation is only needed for RTMs with Pellarin atm corr) select case (RTM_ID) - + case(1,3) - + if ( abs(elev(1)-nodata_generic)=mwp(n)%rgh_wmax) then - + h_mc = mwp(n)%rgh_hmin - + else - + slope = & (mwp(n)%rgh_hmin - mwp(n)%rgh_hmax)/ & (mwp(n)%rgh_wmax - mwp(n)%rgh_wmin) - + h_mc = mwp(n)%rgh_hmax + slope * (soilmoist(n) - mwp(n)%rgh_wmin) - + endif - + ! 2) polarization mixing, Q as defined in CMEM: - + if (freq < 2.e9) then select case (RTM_ID) - + case(1,2) - + Q = 0. ! Q is assumed zero at low frequency case(3,4) - - Q = 0.1771 * h_mc - - case default + + Q = 0.1771 * h_mc + + case default err_msg = 'unknown RTM_ID (during pol mixing)' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - + end select - - else - + + else + Q = 0.35 * (1.0 - exp(-0.6 * (mwp(n)%rgh_polmix**2) * (freq/1.e9) )) - + end if ! rough surface reflectivity select case (RTM_ID) - + case(1,2) - - rsh = ( (1-Q) * roh + Q * rov) * EXP(-h_mc*cos_inc**mwp(n)%rgh_nrh) + + rsh = ( (1-Q) * roh + Q * rov) * EXP(-h_mc*cos_inc**mwp(n)%rgh_nrh) rsv = ( (1-Q) * rov + Q * roh) * EXP(-h_mc*cos_inc**mwp(n)%rgh_nrv) - + case(3,4) - - rsh = ( (1-Q) * roh + Q * rov) * EXP(-h_mc*cos_inc**2) + + rsh = ( (1-Q) * roh + Q * rov) * EXP(-h_mc*cos_inc**2) rsv = ( (1-Q) * rov + Q * roh) * EXP(-h_mc*cos_inc**2) case default - + err_msg = 'unknown RTM_ID (during rough reflectivity)' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - + end select ! ------------------------------------------------------------- @@ -514,118 +514,118 @@ subroutine mwRTM_get_Tb( N_tile, freq, inc_angle, mwp, elev, & ! the if statement above, in conjunction with mwRTM_param_nodata_check() called earlier, ! ensures that we have "good" values for either (vegopacity) or (bh,bv,lewt) - + if ( LDAS_is_nodata( mwp(n)%vegopacity ) ) then - + ! == vwc: Vegetation water content in kg/m2 (=mm) ! needs to be the total columnar vegetation water content, ! depends on greenness/NDVI/LAI... ! VWC=LEWT*LAI, lewt is actually a time-varying parameter! - ! For now LEWT is guessed based on literature, and kept cst. - + ! For now LEWT is guessed based on literature, and kept cst. + vwc = mwp(n)%lewt * lai(n) ! removed contribution of interception water ("capac") ! - !! ! add bit of intercepted water as well - !! + !! ! add bit of intercepted water as well + !! !! vwc = vwc + capac(n) - + ! Vegetation optical thickness tau=b*VWC (eq. (2) in Crow et al. 2005) - + tmpreal = vwc/cos_inc - + exptauh = EXP( -mwp(n)%bh * tmpreal ) exptauv = EXP( -mwp(n)%bv * tmpreal ) else - + exptauh = EXP( -mwp(n)%vegopacity) exptauv = EXP( -mwp(n)%vegopacity) end if - + Tc = soiltemp(n) ! canopy temp = soil temp - + tmpreal = Tc * (1. - mwp(n)%omega) Ah = tmpreal * (1. - exptauh) Av = tmpreal * (1. - exptauv) - + ! Eq.(1) in Crow et al. 2005: ! ! Tb_tov = Tb_soil.e_p.exp(-tau/cos theta) + Tb_veg.(1 + r_r.exp(-tau/cos theta)) - + Tb_h(n) = soiltemp(n) * (1. - rsh) * exptauh + Ah * (1. + rsh * exptauh) Tb_v(n) = soiltemp(n) * (1. - rsv) * exptauv + Av * (1. + rsv * exptauv) - - + + ! ------------------------------------------------------------- ! ! Atmospheric correction ! - ! GDL 23nov10 + ! GDL 23nov10 select case (RTM_ID) - + case(1,3) - + exptauh2 = exptauh * exptauh exptauv2 = exptauv * exptauv - + if (freq<2.e9) then - + call ATMPELLARIN( elev(n)/1000., Tair(n), cos_inc, tau_atm, Tb_ad, Tb_au ) - + else - + err_msg = 'cannot compute atm corr for given freq' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - + end if - + exptau_atm = EXP( - tau_atm/cos_inc ) - + Tb_h(n) = Tb_h(n) + Tb_ad*rsh*exptauh2 ! top-of-veg Tb_h (incl atm. contrib.) Tb_v(n) = Tb_v(n) + Tb_ad*rsv*exptauv2 ! top-of-veg Tb_v (incl atm. contrib.) - + Tb_h(n) = Tb_h(n) * exptau_atm + Tb_au ! top-of-atmosphere Tb_h Tb_v(n) = Tb_v(n) * exptau_atm + Tb_au ! top-of-atmosphere Tb_v case(2,4) - + ! do nothing - + case default - + err_msg = 'unknown RTM_ID (during Pellarin atm corr)' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - + end select else ! snow present, soil frozen, or mwRTM params not available - + Tb_h(n) = nodata_generic Tb_v(n) = nodata_generic - + endif end do - + !if (logit) write(logunit,*) 'exiting mwRTM_get_Tb.' - + end subroutine mwRTM_get_Tb - - + + ! ********************************************************************** - + subroutine atmpellarin( Z, tair, costheta, tau_atm, tb_ad, tb_au) ! opacity and brightness temperature of atmosphere for low-freq microwave ! (up to and incl. L-band) ! - ! GDL, 23nov10 + ! GDL, 23nov10 ! Code based on CMEMv3.0 ! ! reichle, 16 May 2011: included in LDASsa @@ -639,13 +639,13 @@ subroutine atmpellarin( Z, tair, costheta, tau_atm, tb_ad, tb_au) real, intent(in) :: costheta ! cosine of incidence angle [dim-less] real, intent(in) :: Z ! elevation above sea-level [km] real, intent(in) :: tair ! surface air temperature [K] - + real, intent(out) :: tau_atm ! atmospheric opacity [dim-less] real, intent(out) :: tb_ad ! downwelling atm Tb [K] real, intent(out) :: tb_au ! upwelling atm Tb [K] ! local variables - + real :: GOSSAT, TAEQ !--------------------------------------------------------------------- @@ -654,24 +654,24 @@ subroutine atmpellarin( Z, tair, costheta, tau_atm, tb_ad, tb_au) tau_atm = exp( -3.926 - 0.2211 * Z - 0.00369 *tair) - + ! 2. Calculate up- and downward atmospheric radiation GOSSAT = exp(-tau_atm/ costheta) TAEQ = exp( 4.927 + 0.002195 * tair) - + tb_ad = TAEQ*(1. - GOSSAT) + Tb_sky * GOSSAT - + tb_au = TAEQ*(1. - GOSSAT) - + end subroutine atmpellarin - + ! ************************************************************ - + subroutine dielwang( FREQ, WC, TS, wt, wp, poros, sand, clay, eps) - + ! GDL, 28Mar11 ! Code adapted from CMEMv3.0 ! @@ -679,23 +679,23 @@ subroutine dielwang( FREQ, WC, TS, wt, wp, poros, sand, clay, eps) ! ! ! Purpose : - ! Calculate the dielectric constant of a wet soil + ! Calculate the dielectric constant of a wet soil ! Developed and validated for 1.4 and 5 GHz. ! ! Reference: - ! Wang and Schmugge, 1980: An empirical model for the + ! Wang and Schmugge, 1980: An empirical model for the ! complex dielectric permittivity of soils as a function of water ! content. IEEE Trans. Geosci. Rem. Sens., GE-18, No. 4, 288-295. ! !--------------------------------------------------------------------------- - + implicit none - + real, intent(in) :: FREQ ! microwave frequency [Hz] real, intent(in) :: TS ! soil temperature [deg C] - + real, intent(in) :: WC ! volumetric soil water content [m3/m3] - + real, intent(in) :: wt ! transition soil moisture [m3/m3] real, intent(in) :: wp ! wilting point [m3/m3] real, intent(in) :: poros ! porosity @@ -703,40 +703,40 @@ subroutine dielwang( FREQ, WC, TS, wt, wp, poros, sand, clay, eps) real, intent(in) :: clay ! clay fraction [0-1] complex, intent(out) :: eps ! dielectric constant of soil-water mixture [dim-less] - + ! ------------------------------------- - ! + ! ! local variables - complex, parameter :: j = (0. , 1. ) + complex, parameter :: j = (0. , 1. ) real :: gamma ! fitting parameter real :: ecl ! conductivity loss complex :: ew ! dielectric constant of water complex :: ex ! dielectric constant of the initially absorbed water - + real :: alpha - + !--------------------------------------------------------------------------- ! ! 0. Compute dielectric constant of free water ! ! assume soil salinity = 0 - + call DIEL_WAT( 2, 2, TS, 0., FREQ, clay, sand, poros, wc, ew) - + !--------------------------------------------------------------------------- ! ! 1. Calculate dielectric constant of soil-water mixture - + gamma = -0.57 * wp + 0.481 ! wt = 0.49 * wp + 0.165 transition SM parameter from Wang and Schmugge 1980; ! note typo in De Lannoy et al 2013 (0.48 instead of 0.49) - + IF (wc <= wt) THEN - + ex = diel_ice + (ew-diel_ice)*(wc/wt)*gamma eps = wc*ex + (poros-wc)*diel_air + (1.-poros)*diel_rock @@ -748,28 +748,28 @@ subroutine dielwang( FREQ, WC, TS, wt, wp, poros, sand, clay, eps) eps = wt*ex + (wc-wt)*ew + (poros-wc)*diel_air + (1.-poros)*diel_rock ENDIF - + !--------------------------------------------------------------------------- ! ! 2. add conductivity loss (Wang dielectric model) if (FREQ > 2.5e9) then - + alpha = 0. else - + alpha = min( 100.*wp, 26.) - + end if - + ecl = alpha * wc**2. - + eps = eps + j * ecl - + end subroutine dielwang - - + + ! ************************************************************ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) @@ -778,10 +778,10 @@ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) ! ! included in LDASsa, reichle - 2 Jun 2011 - ! Purpose : - ! Calculate dielectric constant of water in three different media : + ! Purpose : + ! Calculate dielectric constant of water in three different media : ! pure water, sea water, soil water - + ! Reference: ! Dielectric constant of pure water ! Ulaby p 2020 @@ -797,17 +797,17 @@ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) ! 1) Dobson '85. Modified Debye expression ! Stern_Gouy double layer theory ! 2) Ulaby p 2024 - + ! Interface : ! medium = pure water(0) sea water(1) soil water(2) ! isal = Stogryn (1) Klein and Swift (2) - + ! local variables : ! N : normality from salinity (Stogryn, modified by Klein and Swift 1977) ! T : temperature of water (C) ! ew : dielectric constant of water - ! sal : water salinity (psu = ppt(weight) ) - ! eps_w0 : static dielectric constant of pure water (Klein and Swift 1977) + ! sal : water salinity (psu = ppt(weight) ) + ! eps_w0 : static dielectric constant of pure water (Klein and Swift 1977) ! eps_sw0 : Static dielectric constant of soil water ! tau_w : relaxation time of pure water (stogryn, 1970) ! tau_sw : relaxation time of saline water @@ -816,7 +816,7 @@ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) !--------------------------------------------------------------------------- IMPLICIT NONE - + INTEGER, intent(in) :: medium ! 0=pure water, 1=sea water, 2=soil water INTEGER, intent(in) :: isal ! 1=Stogryn, 2=Klein and Swift REAL, intent(in) :: T ! temperature of water [C] @@ -828,13 +828,13 @@ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) real, intent(in) :: wc ! soil moisture [m3/m3] COMPLEX, intent(out) :: ew ! dielec. const. of water at given freq, T, sal, etc. - + ! local variables - - complex, parameter :: j = (0. , 1. ) - - real :: rho_b - + + complex, parameter :: j = (0. , 1. ) + + real :: rho_b + REAL :: N, omega, wc_c REAL :: sigma_eff REAL :: tau_w, tau_sw @@ -853,89 +853,89 @@ SUBROUTINE DIEL_WAT( medium, isal, T, sal, freq, clay, sand, poros, wc, ew) ! ! tau_w = 1./(2.*pi) * (1.1109e-10 - 3.824e-12 * T + 6.938e-14 * T**2 & ! - 5.096e-16 * T**3) - + omega = 2.0 * MAPL_PI * freq - rho_b = (1.-poros)*rho_soil ! soil bulk density [g/cm3] - - + rho_b = (1.-poros)*rho_soil ! soil bulk density [g/cm3] + + SELECT CASE (isal) - + CASE ( 1 ) ! Stogryn (1971) - + N = 0.9141 * sal * (1.707e-2 + sal*(1.205e-5 + sal*4.058e-9)) - + eps_sw0 = 87.74 + T*(-0.4008 + T*(9.398e-4 + T*1.410e-6)) a = 1. + N*(-0.2551 + N*(5.151e-2 - N*6.889e-3)) eps_sw0 = eps_sw0 * a - - bb = 1. + N*(-0.04896 + 0.1463e-2*T + N*(-0.02967 + N*5.644e-3)) - + + bb = 1. + N*(-0.04896 + 0.1463e-2*T + N*(-0.02967 + N*5.644e-3)) + tau_sw = tau_w * bb - + CASE ( 2 ) ! Klein and Swift (1977) - + eps_sw0 = 87.134 + T*(-1.949e-1 + T*(-1.276e-2 + T*2.491e-4)) - + a = 1. + sal*( 1.613e-5*T -3.656e-3 + sal*(3.210e-5 - sal*4.232e-7)) - + eps_sw0 = eps_sw0 * a - + bb = 1. + sal*(2.282e-5*T - 7.638e-4 + sal*(-7.760e-6 + sal*1.105e-8)) - + tau_sw = tau_w * bb - + END SELECT - - + + SELECT CASE (medium) - + CASE ( 0 ) ! pure water - + eps_w0 = 88.045 + T*(-0.4147 + T*(6.295e-4 + T*1.075e-5)) - + ew = diel_watinf + (eps_w0 - diel_watinf) / (1. - j * omega * tau_w) - + CASE ( 1 ) ! sea water - + err_msg = 'medium=1 (sea water) not implemented' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - - CASE ( 2 ) ! soil water + + CASE ( 2 ) ! soil water ! changed units of sand, clay to [0-1], reichle, 2 Jun 2011 - - ! Avoid negative sigma_eff for very sandy soils with low bulk densities. - + + ! Avoid negative sigma_eff for very sandy soils with low bulk densities. + sigma_eff = max( 0., -1.645 + 1.939*rho_b - 2.256*sand + 1.594*clay) - + ! Modified Debye expression, Dobson '85 - + wc_c = MAX(0.001, wc) ! to avoid dividing by zero - + ew = diel_watinf + (eps_sw0 - diel_watinf) / (1. - j * omega * tau_sw) & + j * sigma_eff / (omega * eps_0) * (rho_soil - rho_b) / (rho_soil * wc_c) - + END SELECT - + END SUBROUTINE DIEL_WAT - + ! ********************************************************************** - + SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) - + ! Soil dielectric mixing model by Mironov et al IEEE TGRS 2009, doi:10.1109/TGRS.2008.2011631 ! ! 8 May 2023: Implementation taken from SMAP L2_SM_P retrieval model by qliu; clean-up by reichle - + IMPLICIT NONE REAL, INTENT(IN) :: freq ! microwave frequency [Hz] REAL, INTENT(IN) :: mv ! volumetric soil water content [m3/m3] REAL, INTENT(IN) :: clayfrac ! clay fraction [0-1] - + COMPLEX, INTENT(OUT) :: er_r ! complex dielectric constant of moist soil ! ------------------------------ @@ -953,15 +953,15 @@ SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) REAL :: tmptauu, tmptauu2plus1, tmpdiffepsu REAL :: tmpreal, tmprealb, tmprealu - + ! -------------------------------------------------------------------------------------- f = freq ! Section IV C = clayfrac*100 ! Section VI - + !! Mironov's regression expressions based on Curtis, Dobson, and Hallikainen datasets !! - !! mvt : max bound water fraction + !! mvt : max bound water fraction !! !! eps(*) : dielectric constant (real part) and loss factor (imaginary part) !! n(*) : refractive index @@ -973,7 +973,7 @@ SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) !! d: dry soil !! b: bound soil water (BSW) !! u: unbound (free) soil water (FSW) - + nd = 1.634 - 0.539e-2 * C + 0.2748e-4 * C**2 ! Eqn 17 kd = 0.03952 - 0.04038e-2 * C ! Eqn 18 mvt = 0.02863 + 0.30673e-2 * C ! Eqn 19 @@ -983,29 +983,29 @@ SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) sigu = 0.3631 + 1.217e-2 * C ! Eqn 23 eps0u = 100. ! Eqn 24 tauu = 8.5e-12 ! Eqn 25 - + !! Debye relaxation equations for water as a function of frequency ! Eqn 16 - + tmp2PIf = 2.*MAPL_PI*f tmpeps0 = tmp2PIf*eps_0 - + tmptaub = tmp2PIf*taub tmptauu = tmp2PIf*tauu - + tmptaub2plus1 = 1. + tmptaub**2 tmptauu2plus1 = 1. + tmptauu**2 tmpdiffepsb = eps0b - diel_watinf tmpdiffepsu = eps0u - diel_watinf - - epsb_real = diel_watinf + tmpdiffepsb/tmptaub2plus1 + + epsb_real = diel_watinf + tmpdiffepsb/tmptaub2plus1 epsb_imag = tmpdiffepsb/tmptaub2plus1 * tmptaub + sigb/tmpeps0 - epsu_real = diel_watinf + tmpdiffepsu/tmptauu2plus1 + epsu_real = diel_watinf + tmpdiffepsu/tmptauu2plus1 epsu_imag = tmpdiffepsu/tmptauu2plus1 * tmptauu + sigu/tmpeps0 - - !! Refractive indices and normalized attenuation coefficients - + + !! Refractive indices and normalized attenuation coefficients + tmpreal = 1/sqrt(2.0) tmprealb = sqrt( epsb_real**2 + epsb_imag**2 ) @@ -1015,14 +1015,14 @@ SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) kb = tmpreal * sqrt( tmprealb - epsb_real ) ! Eqn 15 nu = tmpreal * sqrt( tmprealu + epsu_real ) ! Eqn 14 ku = tmpreal * sqrt( tmprealu - epsu_real ) ! Eqn 15 - + IF (mv <= mvt) THEN - + nm = nd + (nb - 1.) * mv ! Eqn 12 km = kd + kb * mv ! Eqn 13 - + ELSE - + nm = nd + (nb - 1.) * mvt + (nu - 1.) * (mv - mvt) ! Eqn 12 km = kd + kb * mvt + ku * (mv - mvt) ! Eqn 13 @@ -1032,15 +1032,15 @@ SUBROUTINE MIRONOV( freq, mv, clayfrac, er_r ) er_r_real = nm**2 - km**2 ! Eqn 11 er_r_imag = 2. * nm * km ! Eqn 11 - + er_r = CMPLX(er_r_real,er_r_imag) - + END SUBROUTINE mironov - + ! ********************************************************************** - + end module mwRTM_routines - + ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #if 0 @@ -1048,15 +1048,15 @@ end module mwRTM_routines ! driver routines for testing program test_mwRTM_types - + use mwRTM_routines - + implicit none - + type(mwRTM_param_type) :: mwRTM_param - + mwRTM_param = -9999. - + write (*,*) mwRTM_param end program test_mwRTM_types diff --git a/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_types.F90 b/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_types.F90 index 5c88a945..5080c291 100644 --- a/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_types.F90 +++ b/src/Components/GEOSldas_GridComp/GEOSlandassim_GridComp/mwRTM_types.F90 @@ -12,7 +12,7 @@ module mwRTM_types ! reichle, 21 Oct 2011 - added field "poros" to "mwRTM_param_type" ! ! -------------------------------------------------------------------------- - + use LDAS_ensdrv_globals, ONLY: & nodata_generic, & nodata_tol_generic, & @@ -23,22 +23,22 @@ module mwRTM_types LDAS_GENERIC_ERROR implicit none - + ! everything is private by default unless made public - + private - + public :: mwRTM_param_type public :: mwRTM_param_nodata_check - + public :: assignment (=) - + ! --------------------------------------------------------- - + ! model parameters - + type :: mwRTM_param_type - + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! WARNING: When modifying this derived type make sure that the corresponding ! MPI STRUCTURE in module CLSM_ENSDRV_MPI is also updated, as are @@ -47,19 +47,19 @@ module mwRTM_types integer :: vegcls ! land cover/veg class (can differ from cat_param%vegcls ! ) integer :: soilcls ! soil class (can differ from cat_param%soilcls30! ) - + real :: sand ! sand fraction [0-1] real :: clay ! clay fraction [0-1] - + real :: poros ! porosity (can differ from cat_param%poros!) [m3/m3] ! parameters relating to soil mixing model - + real :: wang_wt ! Wang dielectric model: transition s.m. [m3/m3] real :: wang_wp ! Wang dielectric model: wilting point s.m. [m3/m3] - + ! parameters relating to emissivity of rough surface - + real :: rgh_hmin ! min roughness [dim-less] real :: rgh_hmax ! max roughness [dim-less] real :: rgh_wmin ! soil moisture for transition to hmax [m3/m3] @@ -67,24 +67,24 @@ module mwRTM_types real :: rgh_Nrh ! h-pol exponent for inc angle parameterization [dim-less] real :: rgh_Nrv ! v-pol exponent for inc angle parameterization [dim-less] real :: rgh_polmix ! polarization mixing parameter [dim-less] - + real :: omega ! single scattering albedo [dim-less] - ! parameters relating to vegetation opacity - + ! parameters relating to vegetation opacity + real :: bh ! veg b parameter (h-pol) (tau = b*VWC) [dim-less] real :: bv ! veg b parameter (v-pol) (tau = b*VWC) [dim-less] real :: lewt ! VWC = lewt*LAI [kg/m2] real :: vegopacity ! veg opacity = tau/cos(inc_angle) [dim-less] - + end type mwRTM_param_type - + ! --------------------------------------------------------- - + interface assignment (=) module procedure scalar2mwRTM_param end interface - + contains ! ********************************************************************** @@ -92,43 +92,43 @@ module mwRTM_types ! Subroutine io_mwRTM_param_type() reads and writes binary mwRTM files and is no longer used. ! ! The subroutine has been replaced by: - ! - Applications/LDAS_App/[..]/mwrtm_bin2nc4.F90 converts mwRTM files from binary to nc4 + ! - Components/GEOSldas_GridComp/GEOSldas_App/[..]/mwrtm_bin2nc4.F90 converts mwRTM files from binary to nc4 ! - get_mwrtm_param() in GEOS_LandAssimGridComp.F90 converts the internal state ! variables of the Land Assim GridComp into the mwRTM structure. ! ! reichle, 4 Aug 2020 -! subroutine io_mwRTM_param_type( action, unitnum, N_tile, mwp, N_catg, tile_id, d2g ) -! +! subroutine io_mwRTM_param_type( action, unitnum, N_tile, mwp, N_catg, tile_id, d2g ) +! ! ! read/write mwRTM_param for domain from/to file ! ! ! ! write: write mwRTM params for N_tile tiles in domain ! ! -! ! read: read mwRTM params for -! +! ! read: read mwRTM params for +! ! ! ! ! reichle, 1 Jun 2011 ! ! reichle, 21 Oct 2011 -- added "read" for mwRTM params ! ! reichle, 22 Oct 2012 -- added check for tile_id to mwRTM param input -! ! +! ! ! ! ------------------------------------------------------------------- -! +! ! implicit none -! +! ! character, intent(in) :: action -! +! ! integer, intent(in) :: unitnum -! +! ! integer, intent(in) :: N_tile ! =N_catd -! +! ! type(mwRTM_param_type), dimension(N_tile), intent(inout) :: mwp ! -! integer, optional, intent(in) :: N_catg +! integer, optional, intent(in) :: N_catg ! ! integer, optional, dimension(N_tile), intent(in) :: tile_id, d2g ! ! ! local variables -! +! ! integer :: n, N_tmp ! ! integer, dimension(:), allocatable :: tmpint @@ -140,125 +140,125 @@ module mwRTM_types ! ! ------------------------------------------------------------------ ! ! select case (action) -! +! ! case ('w','W') ! write mwp for all tiles in domain -! +! ! write (unitnum) N_tile -! +! ! write (unitnum) (mwp(n)%vegcls , n=1,N_tile) ! integer ! write (unitnum) (mwp(n)%soilcls , n=1,N_tile) ! integer -! -! write (unitnum) (mwp(n)%sand , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%clay , n=1,N_tile) ! real -! -! write (unitnum) (mwp(n)%poros , n=1,N_tile) ! real -! -! write (unitnum) (mwp(n)%wang_wt , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%wang_wp , n=1,N_tile) ! real -! -! write (unitnum) (mwp(n)%rgh_hmin , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_hmax , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_wmin , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_wmax , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_Nrh , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_Nrv , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%rgh_polmix, n=1,N_tile) ! real -! -! write (unitnum) (mwp(n)%omega , n=1,N_tile) ! real -! -! write (unitnum) (mwp(n)%bh , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%bv , n=1,N_tile) ! real -! write (unitnum) (mwp(n)%lewt , n=1,N_tile) ! real -! +! +! write (unitnum) (mwp(n)%sand , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%clay , n=1,N_tile) ! real +! +! write (unitnum) (mwp(n)%poros , n=1,N_tile) ! real +! +! write (unitnum) (mwp(n)%wang_wt , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%wang_wp , n=1,N_tile) ! real +! +! write (unitnum) (mwp(n)%rgh_hmin , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_hmax , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_wmin , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_wmax , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_Nrh , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_Nrv , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%rgh_polmix, n=1,N_tile) ! real +! +! write (unitnum) (mwp(n)%omega , n=1,N_tile) ! real +! +! write (unitnum) (mwp(n)%bh , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%bv , n=1,N_tile) ! real +! write (unitnum) (mwp(n)%lewt , n=1,N_tile) ! real +! ! case ('r','R') ! ! ! read the parameters for all global tiles (similar to read_land_parameters()) -! +! ! ! optional inputs N_catg and d2g must be present -! +! ! if ( (.not. present(N_catg )) .or. & ! (.not. present(tile_id)) .or. & ! (.not. present(d2g )) ) then ! err_msg = 'missing optional inputs N_catg, tile_id, d2g' ! call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) ! end if -! +! ! ! read how many tiles are in file and double-check against N_catg -! +! ! read (unitnum) N_tmp -! +! ! if (N_tmp .ne. N_catg) then ! err_msg = 'number of tiles in file .ne. N_catg' ! call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) ! end if -! +! ! ! allocate tmp vectors -! +! ! allocate(tmpint( N_catg)) ! allocate(tmpreal(N_catg)) -! +! ! ! read tile IDs (first record) -! +! ! read (unitnum) tmpint; ! ! ! make sure tile IDs match (works only for "SiB2_V2" and newer versions) -! +! ! if (any(tile_id/=tmpint(d2g(1:N_tile)))) then ! err_msg = 'mismatch of tile IDs for mwRTM_parameters' ! call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) ! end if -! +! ! ! read and subset from global tile space to domain -! +! ! read (unitnum) tmpint; mwp(1:N_tile)%vegcls = tmpint( d2g(1:N_tile)) ! read (unitnum) tmpint; mwp(1:N_tile)%soilcls = tmpint( d2g(1:N_tile)) -! +! ! read (unitnum) tmpreal; mwp(1:N_tile)%sand = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%clay = tmpreal(d2g(1:N_tile)) -! +! ! read (unitnum) tmpreal; mwp(1:N_tile)%poros = tmpreal(d2g(1:N_tile)) -! -! read (unitnum) tmpreal; mwp(1:N_tile)%wang_wt = tmpreal(d2g(1:N_tile)) +! +! read (unitnum) tmpreal; mwp(1:N_tile)%wang_wt = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%wang_wp = tmpreal(d2g(1:N_tile)) -! -! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_hmin = tmpreal(d2g(1:N_tile)) +! +! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_hmin = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_hmax = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_wmin = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_wmax = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_Nrh = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_Nrv = tmpreal(d2g(1:N_tile)) -! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_polmix = tmpreal(d2g(1:N_tile)) -! +! read (unitnum) tmpreal; mwp(1:N_tile)%rgh_polmix = tmpreal(d2g(1:N_tile)) +! ! read (unitnum) tmpreal; mwp(1:N_tile)%omega = tmpreal(d2g(1:N_tile)) -! +! ! read (unitnum) tmpreal; mwp(1:N_tile)%bh = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%bv = tmpreal(d2g(1:N_tile)) ! read (unitnum) tmpreal; mwp(1:N_tile)%lewt = tmpreal(d2g(1:N_tile)) -! +! ! ! clean up ! ! deallocate(tmpreal) ! deallocate(tmpint) -! +! ! case default -! +! ! err_msg = 'unknown action ' // action ! call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) -! +! ! end select -! +! ! end subroutine io_mwRTM_param_type - + ! ************************************************************ - + subroutine scalar2mwRTM_param( mwRTM_param, scalar ) - + implicit none - + real, intent(in) :: scalar - + type(mwRTM_param_type), intent(out) :: mwRTM_param - + ! --------------------- mwRTM_param%vegcls = nint(scalar) @@ -281,41 +281,41 @@ subroutine scalar2mwRTM_param( mwRTM_param, scalar ) mwRTM_param%bv = scalar mwRTM_param%lewt = scalar mwRTM_param%vegopacity = scalar - + end subroutine scalar2mwRTM_param ! ************************************************************ - + subroutine mwRTM_param_nodata_check( mwp, mwp_nodata ) ! check microwave radiative transfer model parameters for no-data values ! ! if there is a no-data value in any required field, set "all" fields - ! within the corresponding group of parameters to no-data + ! within the corresponding group of parameters to no-data ! ! vegetation attenuation parameters can come from either of two sources: ! - static look-up table or calibrated parameters (bh, bv, lewt), to be combined ! with time-varying LAI ! - vegetation opacity (from file); varies with time ! - ! preprocessing of the mwRTM restart and vegopacity files must ensure that + ! preprocessing of the mwRTM restart and vegopacity files must ensure that ! either (bh,bv,lewt) or (vegopacity) is no-data ! ! - reichle, 13 July 2021 (revised for using vegopacity from file) - + implicit none - + type(mwRTM_param_type), intent(inout) :: mwp - + logical, intent( out), optional :: mwp_nodata - + ! local variables - + logical :: veg_atten_static_params_nodata, veg_params_nodata, other_params_nodata real :: realvegcls, realsoilcls - character(len=*), parameter :: Iam = 'mwRTM_param_nodata_check' + character(len=*), parameter :: Iam = 'mwRTM_param_nodata_check' character(len=400) :: err_msg ! ----------------------------------------------------------------------------- @@ -328,53 +328,53 @@ subroutine mwRTM_param_nodata_check( mwp, mwp_nodata ) veg_atten_static_params_nodata = & ( & - LDAS_is_nodata( mwp%bh ) .or. & + LDAS_is_nodata( mwp%bh ) .or. & LDAS_is_nodata( mwp%bv ) .or. & LDAS_is_nodata( mwp%lewt ) & ) - + if ( (.not. veg_atten_static_params_nodata) .and. (.not. LDAS_is_nodata( mwp%vegopacity )) ) then - - ! inconsistent mwRTM restart and vegopacity files: + + ! inconsistent mwRTM restart and vegopacity files: ! for a given tile, (bh, bv, lewt) from mwRTM restart and (vegopacity) from file must ! not both have good values - + err_msg = 'inconsistent mwRTM restart and vegopacity files: found good values for (bh,bv,lewt) *and* (vegopacity)' call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg) - + end if ! return if *only* interested in checking no-data consistency for veg attenuation params - + if (.not. present(mwp_nodata)) return - ! - - - - - - - - - - - - - - - - - - - - - - + ! - - - - - - - - - - - - - - - - - - - - - - ! ! rest of subroutine only needs to run once - if ( veg_atten_static_params_nodata ) then - + if ( veg_atten_static_params_nodata ) then + ! make sure all related fields in this group are no-data if at least one is nodata - + mwp%bh = nodata_generic mwp%bv = nodata_generic mwp%lewt = nodata_generic - + end if - + ! veg_params_nodata = .true. if missing vegetation attenuation info altogether - + veg_params_nodata = & ( & veg_atten_static_params_nodata & .and. & - LDAS_is_nodata( mwp%vegopacity ) & + LDAS_is_nodata( mwp%vegopacity ) & ) ! ----------------------------------------------------------------------------- ! Group 2: Parameters for the rest of the tau-omega equations - + realvegcls = real(mwp%vegcls) realsoilcls = real(mwp%soilcls) @@ -395,12 +395,12 @@ subroutine mwRTM_param_nodata_check( mwp, mwp_nodata ) LDAS_is_nodata( mwp%rgh_Nrv ) .or. & LDAS_is_nodata( mwp%rgh_polmix ) .or. & LDAS_is_nodata( mwp%omega ) & - ) + ) if ( other_params_nodata ) then - + ! make sure all related fields in this group are no-data if at least one is nodata - + mwp%vegcls = nint(nodata_generic) mwp%soilcls = nint(nodata_generic) mwp%sand = nodata_generic @@ -416,27 +416,27 @@ subroutine mwRTM_param_nodata_check( mwp, mwp_nodata ) mwp%rgh_Nrv = nodata_generic mwp%rgh_polmix = nodata_generic mwp%omega = nodata_generic - + end if - + ! ----------------------------------------------------------------------------- - + ! need both groups for full tau-omega calculations: - + if ( veg_params_nodata .or. other_params_nodata ) then - + mwp_nodata = .true. - + else - + mwp_nodata = .false. - + end if - + end subroutine mwRTM_param_nodata_check - + end module mwRTM_types - + ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #if 0 @@ -444,15 +444,15 @@ end module mwRTM_types ! driver routines for testing program test_mwRTM_types - + use mwRTM_types - + implicit none - + type(mwRTM_param_type) :: mwRTM_param - + mwRTM_param = -9999. - + write (*,*) mwRTM_param mwRTM_param%lewt = 0.5 @@ -460,8 +460,8 @@ program test_mwRTM_types write (*,*) mwRTM_param call mwRTM_param_nodata_check(mwRTM_param) - - write (*,*) mwRTM_param + + write (*,*) mwRTM_param end program test_mwRTM_types diff --git a/src/Applications/LDAS_App/CMakeLists.txt b/src/Components/GEOSldas_GridComp/GEOSldas_App/CMakeLists.txt similarity index 100% rename from src/Applications/LDAS_App/CMakeLists.txt rename to src/Components/GEOSldas_GridComp/GEOSldas_App/CMakeLists.txt diff --git a/src/Applications/LDAS_App/GEOSldas.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas.F90 similarity index 100% rename from src/Applications/LDAS_App/GEOSldas.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas.F90 diff --git a/src/Applications/LDAS_App/GEOSldas_CAP.rc b/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_CAP.rc similarity index 100% rename from src/Applications/LDAS_App/GEOSldas_CAP.rc rename to src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_CAP.rc diff --git a/src/Applications/LDAS_App/GEOSldas_ExtData.rc b/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_ExtData.rc similarity index 100% rename from src/Applications/LDAS_App/GEOSldas_ExtData.rc rename to src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_ExtData.rc diff --git a/src/Applications/LDAS_App/GEOSldas_HIST.rc b/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_HIST.rc similarity index 100% rename from src/Applications/LDAS_App/GEOSldas_HIST.rc rename to src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_HIST.rc diff --git a/src/Applications/LDAS_App/GEOSldas_LDAS.rc b/src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_LDAS.rc similarity index 100% rename from src/Applications/LDAS_App/GEOSldas_LDAS.rc rename to src/Components/GEOSldas_GridComp/GEOSldas_App/GEOSldas_LDAS.rc diff --git a/src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_adapt.nml b/src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_adapt.nml similarity index 100% rename from src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_adapt.nml rename to src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_adapt.nml diff --git a/src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_catbias.nml b/src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_catbias.nml similarity index 100% rename from src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_catbias.nml rename to src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_catbias.nml diff --git a/src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_ensprop.nml b/src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_ensprop.nml similarity index 100% rename from src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_ensprop.nml rename to src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_ensprop.nml diff --git a/src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_ensupd.nml b/src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_ensupd.nml similarity index 100% rename from src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_ensupd.nml rename to src/Components/GEOSldas_GridComp/GEOSldas_App/LDASsa_DEFAULT_inputs_ensupd.nml diff --git a/src/Applications/LDAS_App/README_LDAS_App b/src/Components/GEOSldas_GridComp/GEOSldas_App/README_LDAS_App similarity index 56% rename from src/Applications/LDAS_App/README_LDAS_App rename to src/Components/GEOSldas_GridComp/GEOSldas_App/README_LDAS_App index d36a506d..3cc60e01 100644 --- a/src/Applications/LDAS_App/README_LDAS_App +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/README_LDAS_App @@ -1,36 +1,36 @@ -README_LDAS_App: README file for GEOSldas/src/Applications/LDAS_App +README_GEOSldas_App: README file for GEOSldas/src/Components/GEOSldas_GridComp/GEOSldas_App rreichle, 8 July 2022: Initial version This directory contains a collection of programs, scripts, and config files, specifically: -[..]/LDAS_App/ +[..]/GEOSldas_App/ - Config files and programs/scripts needed by ldas_setup or lenkf.j (GEOSldas job script). -[..]/LDAS_App/ens_forcing/ +[..]/GEOSldas_App/ens_forcing/ - Scripts needed by lenkf.j to process ensemble-based forcing (primarily for LADAS). -[..]/LDAS_App/sample_config_files/ +[..]/GEOSldas_App/sample_config_files/ -- Sample config files for ldas_setup and HISTORY. +- Sample config files for ldas_setup and HISTORY. -[..]/LDAS_App/util/config/ +[..]/GEOSldas_App/util/config/ - Miscellaneous scripts to (manually) create/modify config files. -[..]/LDAS_App/util/inputs/ +[..]/GEOSldas_App/util/inputs/ - Miscellaneous scripts to (manually) create/modify input files. -[..]/LDAS_App/util/postproc/ +[..]/GEOSldas_App/util/postproc/ -- Miscellaneous scripts for post-processing GEOSldas output. +- Miscellaneous scripts for post-processing GEOSldas output. -[..]/LDAS_App/util/shared/ +[..]/GEOSldas_App/util/shared/ - Miscellaneous shared reader and helper scripts (primarily matlab). -=============== EOF =============================================================== \ No newline at end of file +=============== EOF =============================================================== diff --git a/src/Applications/LDAS_App/ens_forcing/average_ensemble_forcing.py b/src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/average_ensemble_forcing.py similarity index 100% rename from src/Applications/LDAS_App/ens_forcing/average_ensemble_forcing.py rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/average_ensemble_forcing.py diff --git a/src/Applications/LDAS_App/ens_forcing/enpert_forc.csh b/src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/enpert_forc.csh similarity index 100% rename from src/Applications/LDAS_App/ens_forcing/enpert_forc.csh rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/enpert_forc.csh diff --git a/src/Applications/LDAS_App/ens_forcing/ensemble_forc.py b/src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/ensemble_forc.py similarity index 100% rename from src/Applications/LDAS_App/ens_forcing/ensemble_forc.py rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/ensemble_forc.py diff --git a/src/Applications/LDAS_App/ens_forcing/regrid_forc.csh b/src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/regrid_forc.csh similarity index 100% rename from src/Applications/LDAS_App/ens_forcing/regrid_forc.csh rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/regrid_forc.csh diff --git a/src/Applications/LDAS_App/ens_forcing/test_enpert_forc.j b/src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/test_enpert_forc.j similarity index 100% rename from src/Applications/LDAS_App/ens_forcing/test_enpert_forc.j rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ens_forcing/test_enpert_forc.j diff --git a/src/Applications/LDAS_App/ldas_setup b/src/Components/GEOSldas_GridComp/GEOSldas_App/ldas_setup similarity index 100% rename from src/Applications/LDAS_App/ldas_setup rename to src/Components/GEOSldas_GridComp/GEOSldas_App/ldas_setup diff --git a/src/Applications/LDAS_App/lenkf.j.template b/src/Components/GEOSldas_GridComp/GEOSldas_App/lenkf.j.template similarity index 100% rename from src/Applications/LDAS_App/lenkf.j.template rename to src/Components/GEOSldas_GridComp/GEOSldas_App/lenkf.j.template diff --git a/src/Applications/LDAS_App/preprocess_ldas.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/preprocess_ldas.F90 similarity index 100% rename from src/Applications/LDAS_App/preprocess_ldas.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/preprocess_ldas.F90 diff --git a/src/Applications/LDAS_App/preprocess_ldas_routines.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/preprocess_ldas_routines.F90 similarity index 100% rename from src/Applications/LDAS_App/preprocess_ldas_routines.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/preprocess_ldas_routines.F90 diff --git a/src/Applications/LDAS_App/process_hist.csh b/src/Components/GEOSldas_GridComp/GEOSldas_App/process_hist.csh similarity index 100% rename from src/Applications/LDAS_App/process_hist.csh rename to src/Components/GEOSldas_GridComp/GEOSldas_App/process_hist.csh diff --git a/src/Applications/LDAS_App/remap_config_ldas.py b/src/Components/GEOSldas_GridComp/GEOSldas_App/remap_config_ldas.py similarity index 100% rename from src/Applications/LDAS_App/remap_config_ldas.py rename to src/Components/GEOSldas_GridComp/GEOSldas_App/remap_config_ldas.py diff --git a/src/Applications/LDAS_App/sample_config_files/LADAS/HISTORY.rc.atmens b/src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/HISTORY.rc.atmens similarity index 99% rename from src/Applications/LDAS_App/sample_config_files/LADAS/HISTORY.rc.atmens rename to src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/HISTORY.rc.atmens index 0f3e7f1e..5b24ddf9 100644 --- a/src/Applications/LDAS_App/sample_config_files/LADAS/HISTORY.rc.atmens +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/HISTORY.rc.atmens @@ -2,19 +2,19 @@ # # Sample GEOSldas HISTORY.rc file for LADAS (atm ensemble) # -# - This sample HISTORY.rc is for the GEOSldas instance that is weakly coupled with the +# - This sample HISTORY.rc is for the GEOSldas instance that is weakly coupled with the # atmospheric ensemble component of the Hybrid-4DEnVar ADAS (ADASens). # -# - The sample file was generated with the utility script -# "GEOSldas/src/Applications/LDAS_App/util/config/generate_catchincr_hist.py". +# - The sample file was generated with the utility script +# "GEOSldas/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/generate_catchincr_hist.py". # -# - The sample file triggers output of the GEOSldas "catch_progn_incr" collection in +# - The sample file triggers output of the GEOSldas "catch_progn_incr" collection in # ensemble space, which is needed by ADASens. # # - The IDs of the ensemble members and their total number in GEOSldas must match # those of ADASens. # -# - The "catch_progn_incr" output is in tile space, which must be the same for +# - The "catch_progn_incr" output is in tile space, which must be the same for # GEOSldas and ADASens. # # diff --git a/src/Applications/LDAS_App/sample_config_files/LADAS/HISTORY.rc.central b/src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/HISTORY.rc.central similarity index 100% rename from src/Applications/LDAS_App/sample_config_files/LADAS/HISTORY.rc.central rename to src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/HISTORY.rc.central diff --git a/src/Applications/LDAS_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.atmens b/src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.atmens similarity index 100% rename from src/Applications/LDAS_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.atmens rename to src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.atmens diff --git a/src/Applications/LDAS_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.central b/src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.central similarity index 100% rename from src/Applications/LDAS_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.central rename to src/Components/GEOSldas_GridComp/GEOSldas_App/sample_config_files/LADAS/exeinp.txt.Hy4dEnVar.central diff --git a/src/Applications/LDAS_App/tile_bin2nc4.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/tile_bin2nc4.F90 similarity index 100% rename from src/Applications/LDAS_App/tile_bin2nc4.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/tile_bin2nc4.F90 diff --git a/src/Applications/LDAS_App/util/config/Create_ccorr_cat_progn_default.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/Create_ccorr_cat_progn_default.m similarity index 100% rename from src/Applications/LDAS_App/util/config/Create_ccorr_cat_progn_default.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/Create_ccorr_cat_progn_default.m diff --git a/src/Applications/LDAS_App/util/config/generate_catchincr_hist.py b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/generate_catchincr_hist.py similarity index 89% rename from src/Applications/LDAS_App/util/config/generate_catchincr_hist.py rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/generate_catchincr_hist.py index ce15d61f..a6926450 100755 --- a/src/Applications/LDAS_App/util/config/generate_catchincr_hist.py +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/generate_catchincr_hist.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -# This code works with the python version loaded by g5_modules associated with GEOSldas v17.13.1: -# python/GEOSpyD/Min4.11.0_py3.9_AND_Min4.8.3_py2.7 +# This code works with the python version loaded by g5_modules associated with GEOSldas v17.13.1: +# python/GEOSpyD/Min4.11.0_py3.9_AND_Min4.8.3_py2.7 # # This script generates a sample HISTORY.rc file for GEOSldas to write Catchment # model analysis increments in ensemble space, as needed in the weakly-coupled @@ -25,19 +25,19 @@ # # Sample GEOSldas HISTORY.rc file for LADAS (atm ensemble) # -# - This sample HISTORY.rc is for the GEOSldas instance that is weakly coupled with the +# - This sample HISTORY.rc is for the GEOSldas instance that is weakly coupled with the # atmospheric ensemble component of the Hybrid-4DEnVar ADAS (ADASens). # -# - The sample file was generated with the utility script -# "GEOSldas/src/Applications/LDAS_App/util/config/generate_catchincr_hist.py". +# - The sample file was generated with the utility script +# "GEOSldas/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/generate_catchincr_hist.py". # -# - The sample file triggers output of the GEOSldas "catch_progn_incr" collection in +# - The sample file triggers output of the GEOSldas "catch_progn_incr" collection in # ensemble space, which is needed by ADASens. # # - The IDs of the ensemble members and their total number in GEOSldas must match # those of ADASens. # -# - The "catch_progn_incr" output is in tile space, which must be the same for +# - The "catch_progn_incr" output is in tile space, which must be the same for # GEOSldas and ADASens. # # @@ -89,15 +89,15 @@ # ------------------------------------------------------------------ # -# write file "HISTORY.rc" with nens "catch_progn_incrXXXX" collections, +# write file "HISTORY.rc" with nens "catch_progn_incrXXXX" collections, # one for each ensemble member with open('HISTORY.rc', 'w') as f: f.write(heads) collection, body = hist_template.split('::\n') - collection = collection.strip('\n').strip("'") + collection = collection.strip('\n').strip("'") for i in range(nens): - i = i +1 + i = i +1 sfx = '%04d'%(i) ids = "'"+collection+sfx+"'" f.write(ids+'\n') @@ -112,10 +112,10 @@ if ":" in line : newline = collect+line if "CATCHINCR_e" in newline: - sfx = '%04d'%(i) + sfx = '%04d'%(i) frep = 'CATCHINCR_e'+sfx newline = newline.replace('CATCHINCR_e',frep) f.write(newline+'\n') - f.write('::\n') + f.write('::\n') # ====================== EOF ===================================== diff --git a/src/Applications/LDAS_App/util/config/rewind_GEOSldas.csh b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/rewind_GEOSldas.csh similarity index 100% rename from src/Applications/LDAS_App/util/config/rewind_GEOSldas.csh rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/config/rewind_GEOSldas.csh diff --git a/src/Applications/LDAS_App/util/inputs/ASCAT_sm_mask/CMakeLists.txt b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/ASCAT_sm_mask/CMakeLists.txt similarity index 100% rename from src/Applications/LDAS_App/util/inputs/ASCAT_sm_mask/CMakeLists.txt rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/ASCAT_sm_mask/CMakeLists.txt diff --git a/src/Applications/LDAS_App/util/inputs/ASCAT_sm_mask/ascat_mask_maker.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/ASCAT_sm_mask/ascat_mask_maker.F90 similarity index 100% rename from src/Applications/LDAS_App/util/inputs/ASCAT_sm_mask/ascat_mask_maker.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/ASCAT_sm_mask/ascat_mask_maker.F90 diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m similarity index 93% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m index 6a9859ce..a478214b 100644 --- a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_mwRTM_param_file.m @@ -1,33 +1,33 @@ % --------------------------------------------------------------------------- -% This script is to generate the mwRTM_param.nc4 file for the GEOSldas mwRTM. -% All constant mwRTM parameters are in this file. They come from 3 different +% This script is to generate the mwRTM_param.nc4 file for the GEOSldas mwRTM. +% All constant mwRTM parameters are in this file. They come from 3 different % sources: cat_param, vegcls lookup table and preprocessed L2DCA daily mat files. -% Therefore, need to run Preprocess_L2DCA_mwRTM_into_dailymat.m before running -% this script. +% Therefore, need to run Preprocess_L2DCA_mwRTM_into_dailymat.m before running +% this script. % qliu + rreichle, 29 Jul 2022 % ---------------------------------------------------------------------------- -clear +clear -% add path to matlab functions in src/Applications/LDAS_App/util/shared/matlab/ +% add path to matlab functions in src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/ addpath('../../shared/matlab/'); -% option to fill small gaps based on neighboring grids, 1 is recommended. -fill_small_gaps = 1; +% option to fill small gaps based on neighboring grids, 1 is recommended. +fill_small_gaps = 1; % fill value in output file fillValue = single(1.e15); % resolution of output parameters: only works with "M09" or "M36". -EASEv2_grid = 'M09'; +EASEv2_grid = 'M09'; % older version mwRTM_param.nc4 file for parameter names and attributes -fname_in = ['/home/qliu/smap/SMAP_Nature/bcs/RTM_params/RTMParam_SMAP_L4SM_v004/SMAP_EASEv2_',EASEv2_grid,'/mwRTM_param.nc4']; +fname_in = ['/home/qliu/smap/SMAP_Nature/bcs/RTM_params/RTMParam_SMAP_L4SM_v004/SMAP_EASEv2_',EASEv2_grid,'/mwRTM_param.nc4']; % target mwRTM_param file name -fname_out = ['/home/qliu/smap/SMAP_Nature/bcs/RTM_params/RTMParam_L2_omega_H_tmp/SMAP_EASEv2_',EASEv2_grid,'/mwRTM_param_L2_omega_H_fillValue_bhbvlewt.nc4']; +fname_out = ['/home/qliu/smap/SMAP_Nature/bcs/RTM_params/RTMParam_L2_omega_H_tmp/SMAP_EASEv2_',EASEv2_grid,'/mwRTM_param_L2_omega_H_fillValue_bhbvlewt.nc4']; % get inputs for fill_gaps_in_tiledata() below if fill_small_gaps @@ -41,18 +41,18 @@ else error('invalid resolution, use ''M09'' or ''M36'' only') end - + tmpstr = num2str(N_cells); fname_out = strrep(fname_out,'.nc4','_',tmpstr,'gx',tmpstr,'gfilled.nc4'); end -% Do not overwrite if file exists +% Do not overwrite if file exists if exist(fname_out,'file') - + disp(['file exist ',fname_out]) return - + end % GEOSldas experiment for tilecoord and cat_params @@ -104,7 +104,7 @@ L2_param = get_L2_RTM_constants_tile_data(tc,L2_file_tag,... L2_version,L2_start_time, L2_end_time); omega = L2_param.Albedo; -hparam = L2_param.Roughness; +hparam = L2_param.Roughness; clear L2_param % cat_param based parameters @@ -137,39 +137,39 @@ nvar_in_file = length(finfo.Variables); for i=1: nvar_in_file - + data_name = finfo.Variables(i).Name; data_type = finfo.Variables(i).Datatype; - + data_type = 'float'; - + data_size = finfo.Variables(i).Size; - + varid(i) = netcdf.defVar(fout_id, data_name, data_type, Dim_id ); - + netcdf.defVarFill(fout_id, varid(i), false, fillValue); - + n_attr = length(finfo.Variables(i).Attributes); - + for iv = 1:n_attr att_name = finfo.Variables(i).Attributes(iv).Name; att_value = finfo.Variables(i).Attributes(iv).Value; - + netcdf.putAtt(fout_id, varid(i), att_name, att_value); end - + netcdf.endDef(fout_id); - + startVAR = repmat([0], 1, length(data_size)); countVAR = data_size; - + % get parameter values from their respective sources % Total of 18 mwRTM parameters: % 8 from cat_param: SOILCLS, SOIL, CLAY, POROS, WANGWT, WANTWP, RGHWMIN, RGHWMAX % 4 from vegcls lookup table : VEGCLS, RGHNRH, RGHNRV,POLMIX % 3 from L2RTM: RGHHMIN, RGHHMAX, OMEGA % 3 are set to fillValue: BH,BV, OMEGA - + if strcmp(data_name,'MWRTM_OMEGA') if fill_small_gaps omega_filled = fill_gaps_in_tiledata(tc, tg, transpose(omega), N_cells, iscube ); @@ -187,7 +187,7 @@ elseif strcmp(data_name,'MWRTM_SOILCLS') data = mwRTMparam.soilcls; elseif strcmp(data_name,'MWRTM_SAND') - data = mwRTMparam.sand; + data = mwRTMparam.sand; elseif strcmp(data_name,'MWRTM_CLAY') data = mwRTMparam.clay; elseif strcmp(data_name,'MWRTM_POROS') @@ -217,7 +217,7 @@ data = tmp_rtm.vegcls; elseif strcmp(data_name,'MWRTM_RGHPOLMIX') data = tmp_rtm.rgh_polmix; - end + end end % earlier fillValue was -9999. replace with new fillValue (1.e15) @@ -226,9 +226,9 @@ data(isnan(data)) = fillValue; netcdf.putVar(fout_id, varid(i), startVAR, countVAR, data); clear data - + netcdf.reDef(fout_id); - + end netcdf.endDef(fout_id); diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m similarity index 93% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m index 13272941..19eb1336 100644 --- a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Create_vegopacity_8day_clim.m @@ -1,18 +1,18 @@ -% script to create 8-day climatology of vegetation opacity for L-band microwave +% script to create 8-day climatology of vegetation opacity for L-band microwave % radiative transfer model (mwRTM) % % requires pre-processing of SMAP L2 data into daily *.mat files using % Preprocess_L2DCA_mwRTM_params_to_dailymat.m -% +% % output files written in MAPL_ReadForcing format % % qliu + rreichle, 29 Jul 2022 % % ------------------------------------------------------------------------------------- -clear +clear -% add path to matlab functions in src/Applications/LDAS_App/util/shared/matlab/ +% add path to matlab functions in src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/ addpath('../../shared/matlab/'); L2_Ascdes_all = {'_A_','_D_'}; @@ -64,31 +64,31 @@ float_precision = 'float32'; for iAD = 1:2 - + L2_Ascdes = L2_Ascdes_all{iAD}; L2_qc_yes = 1; - + dtstep = 10800; - + % time period for computing climatology start_time.year = 2015; start_time.month = 4; start_time.day = 1; - + start_time.hour = 1; start_time.min = 30; start_time.sec = 0; - + end_time.year = 2022; end_time.month = 4; end_time.day = 1; end_time.hour = start_time.hour; end_time.min = start_time.min; end_time.sec = start_time.sec; - + start_time = get_dofyr_pentad(start_time); end_time = get_dofyr_pentad(end_time); - + % lookup table of month and day of first day in 8-day average (non-leap year) clim_8d_m1 = [ 1 1 1 1 2 2 2 2 ... @@ -104,12 +104,12 @@ 4 12 20 28 5 13 21 29 ... 6 14 22 30 8 16 24 ... 1 9 17 25 3 11 19 27 ]; - + clim_8d_m2 = [clim_8d_m1(2:46) 1]; clim_8d_d2 = [clim_8d_d1(2:46) 1]; - + % ----------------------------------------------------------------------- - % read from preprocessed daily mat file + % read from preprocessed daily mat file if end_time.month ==1 time_tag = [num2str(start_time.year,'%4.4d'),num2str(start_time.month,'%2.2d'), ... '_',num2str(end_time.year-1,'%4.4d'),'12']; @@ -117,36 +117,36 @@ time_tag = [num2str(start_time.year,'%4.4d'),num2str(start_time.month,'%2.2d'), ... '_',num2str(end_time.year,'%4.4d'),num2str(end_time.month-1,'%2.2d')]; end - + fname_clim = [out_path,'/',out_Para,'_clim_L2_',L2_version,L2_Ascdes,'8d_',resolution,'tile_',time_tag,'_w24d.bin']; - + L2_tau_clim_sum = zeros(46,out_Nlon,out_Nlat); N_L2_clim_sum = zeros(46,out_Nlon,out_Nlat); - + if exist(fname_clim,'file') - + disp(['found preprocessed climatology file ',fname_clim]) - + else - + date_time = start_time; - + while 1 - + if (date_time.year ==end_time.year && ... date_time.month==end_time.month && ... date_time.day ==end_time.day ) break end - + outfile_tag = [num2str(date_time.year,'%4.4d'), ... num2str(date_time.month,'%2.2d'), ... num2str(date_time.day,'%2.2d')]; - + mat_fname = [out_path,'L2DCA_RTM_',L2_file_tag,'_',L2_version,L2_Ascdes, outfile_tag,'.mat']; - + if exist(mat_fname,'file') - + disp(['loading ', mat_fname]) if contains(fname_clim,'VOD_') load(mat_fname,'L2_tau') @@ -159,7 +159,7 @@ else error(['unknown clim fname ',fname_clim]) end - + d_idx = find(date_time.month == clim_8d_m1 & date_time.day >= clim_8d_d1); if ~isempty(d_idx) d_idx = d_idx(end); @@ -167,44 +167,44 @@ d_idx = find(date_time.month == clim_8d_m2 & date_time.day < clim_8d_d2); d_idx = d_idx(1); end - + % compute climatology tmp = max(L2_tau,0); % make sure no negative values in tau tmp(isnan(tmp)) = 0; - + L2_tau_clim_sum(d_idx,:,:) = squeeze(L2_tau_clim_sum(d_idx,:,:)) + tmp; clear tmp tmp = ~isnan(L2_tau); N_L2_clim_sum(d_idx,:,:) = squeeze(N_L2_clim_sum(d_idx,:,:)) + tmp; clear tmp - + clear L2_tau - + else - + error('daily mat file not found') - + end - + date_time = augment_date_time(86400, date_time); - + end - + L2_tau_clim = L2_tau_clim_sum ./N_L2_clim_sum; - - + + % regrid to til grid - + L2_tau_tile = NaN + ones(46, tc.N_tile); for k = 1:tc.N_tile L2_tau_tile(:,k) = L2_tau_clim(:,tc.i_indg(k)+1, tc.j_indg(k)+1); end - + ifp = fopen(fname_clim,'w','l'); - + for n = 1: 48 if n == 1 y1 = 0; y2 = 1; - + nidx = 46; nidx_pre = 45; nidx_nxt = 1; @@ -217,7 +217,7 @@ elseif n == 47 y1 = 1; y2 = 2; - + nidx = n-1; nidx_pre = n-2; nidx_nxt = 1; @@ -238,25 +238,25 @@ m2 = clim_8d_m2(nidx); d1 = clim_8d_d1(nidx); d2 = clim_8d_d2(nidx); - + header = [y1 m1 d1 0 0 0 y2 m2 d2 0 0 0 tc.N_tile 1]; - + tile_data = mean(L2_tau_tile([nidx_pre nidx nidx_nxt],:),1,"omitnan"); tile_data(isnan(tile_data)) = 1.e15; - + fwrite( ifp, 14*4, int_precision ); % fortran_tag fwrite( ifp, header, float_precision ); fwrite( ifp, 14*4, int_precision ); % fortran_tag - + fwrite( ifp, tc.N_tile*4, int_precision );% fortran_tag fwrite( ifp, tile_data(:), float_precision ); fwrite( ifp, tc.N_tile*4, int_precision );% fortran_tag - + clear header tile_data end fclose(ifp) end - + end % ======================== @@ -265,29 +265,29 @@ % time constant with maximum spatial coverage data_clim_tile = NaN + ones(48, tc.N_tile,2); for iAD = 1:2 - + L2_Ascdes = L2_Ascdes_all{iAD}; - + fname = [out_path,'/',out_Para,'_clim_L2_',L2_version,L2_Ascdes,'8d_',resolution,'tile_',time_tag,'_w24d.bin']; - + disp(['read ',fname]) ifp = fopen(fname,'r','l'); - + for n = 1:48 - + fortran_tag = fread( ifp, 1, int_precision ); tmp = fread( ifp, 14, float_precision ); header(n,:) = tmp; fortran_tag = fread( ifp, 1, int_precision ); - + fortran_tag = fread( ifp, 1, int_precision ); tmp = fread( ifp, tc.N_tile, float_precision ); fortran_tag = fread( ifp, 1, int_precision ); - + data_clim_tile(n,:,iAD) = tmp; - + end - + fclose(ifp); end @@ -298,7 +298,7 @@ tile_data = mean(data_clim_tile,3,"omitnan"); fname_out = strrep(fname, L2_Ascdes,'_AD_'); if fill_small_gaps - + if strcmp(resolution,'M09') N_cells = 5; iscube = 0; @@ -308,9 +308,9 @@ else error('invalid resolution, use ''M09'' or ''M36'' only') end - + tmpstr = num2str(N_cells); - + fname_out = [fname_out(1:end-4),'_',tmpstr,'gx',tmpstr,'gfilled_test.bin']; tile_data = fill_gaps_in_tiledata(tc, tg, tile_data, N_cells, iscube ); @@ -329,7 +329,7 @@ fwrite( ifp, 14*4, int_precision ); fwrite( ifp, header(n,:), float_precision ); fwrite( ifp, 14*4, int_precision ); - + % write science data fwrite( ifp, tc.N_tile*4, int_precision ); diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m similarity index 89% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m index 6e2d9fdf..061229b4 100644 --- a/src/Applications/LDAS_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m @@ -1,18 +1,18 @@ -% Script to read SMAP L2 files and extract RTM variables (albedo, vegopacity, roughness) +% Script to read SMAP L2 files and extract RTM variables (albedo, vegopacity, roughness) % to store in global EASEv2 grid daily composite (Asc and Desc separately) mat files for future use. % Q. Liu 18 Jul 2022 - -clear -% add path to matlab functions in src/Applications/LDAS_App/util/shared/matlab/ +clear + +% add path to matlab functions in src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/ addpath('../../shared/matlab/'); -L2_Ascdes = {'_A_','_D_'}; +L2_Ascdes = {'_A_','_D_'}; L2_qc_yes = 1; % L2 file information. Use 'L2_SM_P' for M36 resolution and 'L2_SM_P_E' for M09 -SMAP_product = 'L2_SM_P'; %'L2_SM_P'; +SMAP_product = 'L2_SM_P'; %'L2_SM_P'; L2_path = ['/discover/nobackup/projects/gmao/smap/SMAP_L4/SMAP/OPS/',SMAP_product,'/'] ; L2_version = 'R18290'; %'R17000'; @@ -25,7 +25,7 @@ start_time.month = 4; start_time.day = 1; -end_time.year = 2022; +end_time.year = 2022; end_time.month = 4; end_time.day = 1; @@ -51,43 +51,43 @@ date_time.hour = 0; date_time.min = 0; date_time.sec = 0; - + fname_L2_pre = []; - + while 1 - + if (date_time.year ==end_time.year && ... date_time.month==end_time.month && ... date_time.day ==end_time.day ) break end - + outfile_tag = [num2str(date_time.year,'%4.4d'), ... num2str(date_time.month,'%2.2d'), ... num2str(date_time.day,'%2.2d')]; - + mat_fname = [out_path,'L2DCA_RTM_',SMAP_product,'_',L2_version,L2_Ascdes{iorb}, outfile_tag,'.mat']; - + if exist(mat_fname,'file') - + disp(['mat file exist ',mat_fname]) - + else - + L2_tau = NaN + ones(out_Nlon,out_Nlat); L2_omg = NaN + ones(out_Nlon,out_Nlat); L2_h = NaN + ones(out_Nlon,out_Nlat); - + L2_data_path = [L2_path, '/Y', num2str(date_time.year,'%4.4d'), ... '/M', num2str(date_time.month, '%2.2d'), ... '/D', num2str(date_time.day, '%2.2d')]; - + % get list of all files in subdirectory of given date L2_files_all = dir([L2_data_path, '/SMAP_',SMAP_product,'*',L2_Ascdes{iorb},'*_',L2_version,'_*.h5']); - + % check if multiple versions of the same half orbit file % only keep the data with the highest version id - + L2_files = {}; kk = 0; % counter of the final file list % Remove duplicate files from the list when multiple versions exist @@ -105,65 +105,65 @@ L2_files{kk} = L2_files_all(ff).name; end end - + clear L2_fiels_all L2_fname if ~isempty(L2_files) - + for ifile = 1:length(L2_files) L2_fname{ifile} = [L2_data_path,'/', L2_files{ifile}]; end - + if ~isempty(fname_L2_pre) L2_fname((ifile+1):(ifile+length(fname_L2_pre))) = fname_L2_pre; end - + fname_L2_pre = []; - + ii = 0; for ifile = 1: length(L2_fname) - + fname = L2_fname{ifile}; - + disp(fname) - + L2_row = h5read(fname,'/Soil_Moisture_Retrieval_Data/EASE_row_index'); %zero-based L2_row = L2_row + 1; L2_col = h5read(fname,'/Soil_Moisture_Retrieval_Data/EASE_column_index'); L2_col = L2_col + 1; - + L2_utc_seconds = h5read(fname,'/Soil_Moisture_Retrieval_Data/tb_time_seconds'); - + L2_vod = h5read(fname,'/Soil_Moisture_Retrieval_Data/vegetation_opacity_option3'); fill_value = h5readatt(fname,'/Soil_Moisture_Retrieval_Data/vegetation_opacity_option3','_FillValue'); L2_vod(L2_vod == fill_value) = NaN; - + L2_alb = h5read(fname,'/Soil_Moisture_Retrieval_Data/albedo_option3'); fill_value = h5readatt(fname,'/Soil_Moisture_Retrieval_Data/albedo_option3','_FillValue'); L2_alb(L2_alb == fill_value) = NaN; - + L2_rough = h5read(fname,'/Soil_Moisture_Retrieval_Data/roughness_coefficient_option3'); fill_value = h5readatt(fname,'/Soil_Moisture_Retrieval_Data/roughness_coefficient_option3','_FillValue'); L2_rough(L2_rough == fill_value) = NaN; - + % quality flag L2_qf = h5read(fname,'/Soil_Moisture_Retrieval_Data/retrieval_qual_flag_option3'); - + % surface status land = 0, nonland = 1 L2_ss = h5read(fname,'/Soil_Moisture_Retrieval_Data/grid_surface_status'); - + % surface flag L2_sf = h5read(fname,'/Soil_Moisture_Retrieval_Data/surface_flag'); - + L2_rfi_h = h5read(fname,'/Soil_Moisture_Retrieval_Data/tb_qual_flag_h'); L2_rfi_v = h5read(fname,'/Soil_Moisture_Retrieval_Data/tb_qual_flag_v'); - + % exclude points according to quality flag if L2_qc_yes - + % QC based on retrieval quality flag %L2_rt = bitget(L2_qf, 1); % only use retrieval_recommended L2_rt = bitget(L2_qf, 3); % use retrieval_succeeded - + % QC b ased on surface flag L2_frozen_model = bitget(L2_sf, 9); % model frozen ground L2_snow = bitget(L2_sf,6); % snow and ice @@ -173,7 +173,7 @@ idx = find(L2_rt == 0 & L2_frozen_model ==0 & ... L2_snow == 0 & L2_pice ==0 & L2_ss == 0 & ... L2_rfi_h_qf == 0 & L2_rfi_v_qf == 0); - + % only keep data/coord that pass QC L2_vod = L2_vod(idx); L2_alb = L2_alb(idx); @@ -183,25 +183,25 @@ L2_utc_seconds = L2_utc_seconds(idx); clear idx end - + if ~isempty(L2_vod) - + % round date_time to nearest 3 hourly UTC utc_t2k = round(double(L2_utc_seconds)/L2_dtstep)*L2_dtstep; - + [yr, doy, mm, dd, hr, mn] = J2000_to_DateTime( utc_t2k ); - + % use points for current UTC day only idx = find(yr == date_time.year & mm == date_time.month & ... dd == date_time.day); - + % points across UTC days will be saved in next daily file if length(idx) < length(L2_utc_seconds) && ifile <= length(L2_files) disp('L2 across UTC days') ii = ii + 1; fname_L2_pre{ii} = fname; end - + L2_vod = L2_vod(idx); L2_alb = L2_alb(idx); L2_rough = L2_rough(idx); @@ -210,30 +210,30 @@ L2_utc_seconds = L2_utc_seconds(idx); hr = hr(idx); clear idx - + % Map L2 to 2d grid for k = 1:length(L2_vod) this_col = L2_col(k); this_row = L2_row(k); - + L2_tau(this_col, this_row) = L2_vod(k); L2_omg(this_col, this_row) = L2_alb(k); L2_h(this_col, this_row) = L2_rough(k); end end end - + else - + disp(['no L2 data found in', L2_data_path]) pause end - + save(mat_fname,'L2_tau','L2_omg','L2_h') clear L2_tau L2_omg L2_h - + end - + date_time = augment_date_time(86400, date_time); end end diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/fill_gaps_in_tiledata.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/fill_gaps_in_tiledata.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/fill_gaps_in_tiledata.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/fill_gaps_in_tiledata.m diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/get_L2_RTM_constants_tile_data.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_L2_RTM_constants_tile_data.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/get_L2_RTM_constants_tile_data.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_L2_RTM_constants_tile_data.m diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/get_mwRTM_lookup.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_mwRTM_lookup.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/get_mwRTM_lookup.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_mwRTM_lookup.m diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/get_mwRTM_vegcls_based.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_mwRTM_vegcls_based.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/get_mwRTM_vegcls_based.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/get_mwRTM_vegcls_based.m diff --git a/src/Applications/LDAS_App/util/inputs/mwRTM_params/mwrtm_bin2nc4.F90 b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/mwrtm_bin2nc4.F90 similarity index 100% rename from src/Applications/LDAS_App/util/inputs/mwRTM_params/mwrtm_bin2nc4.F90 rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/mwRTM_params/mwrtm_bin2nc4.F90 diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m similarity index 90% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m index 62f54caa..b7e914fc 100644 --- a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_L4_Tb_scale_SMAP.m @@ -6,7 +6,7 @@ clear -% add path to matlab functions in src/Applications/LDAS_App/util/shared/matlab/ +% add path to matlab functions in src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/ addpath('../../shared/matlab/'); %====== @@ -35,8 +35,8 @@ dt_assim = 3*60*60; % [seconds] land analysis time step, % same as LANDASSIM_DT in GEOSldas) -t0_assim = 0; % [seconds] land analysis "reference" time (offset from 0z), - % same as LANDASSIM_T0 in GEOSldas (except for units), +t0_assim = 0; % [seconds] land analysis "reference" time (offset from 0z), + % same as LANDASSIM_T0 in GEOSldas (except for units), % typically 0 in offline runs and 1.5*60*60 in LADAS %====== @@ -66,7 +66,7 @@ hscale = 0.0; % degrees lat/lon % Temporal sampling window(days), current hard coded and need to be divisive by 5 and be an odd number -w_days = 75; +w_days = 75; Ndata_min = 20; @@ -93,15 +93,15 @@ for oo=1:length(orbit) for pp=1:length(pol) for aa=1:length(inc_ang) - + add_species = obs_param(strcmp(var_name,{obs_param.varname}) & ... orbit(oo) == [obs_param.orbit] & ... inc_ang(aa) == [obs_param.ang] & ... pol(pp) == [obs_param.pol] & ... ~cellfun(@isempty, strfind({obs_param.descr},descr))).species; - + species = union(species,add_species); - + end end end @@ -110,65 +110,65 @@ % ------------------ for n=1:length(exp_run) - + if (exist('convert_grid','var')) - + if exist('time_of_day_in_hours','var') - - + + for j=1:length(time_of_day_in_hours) - + for k=1:length(run_months) - + get_model_and_obs_clim_stats( var_name, ... run_months{k}, exp_path, exp_run{n}, domain, ... start_year, end_year, ... dt_assim, t0_assim, species, obs_param, ... hscale, inc_ang, int_Asc, w_days, Ndata_min, prefix_out,... convert_grid, time_of_day_in_hours(j) ); - + end - + end - + else - + get_model_and_obs_clim_stats( var_name, ... run_months, exp_path, exp_run{n}, domain, start_year, end_year, ... dt_assim, t0_assim, species, obs_param, ... hscale, inc_ang, int_Asc, w_days, Ndata_min, prefix_out,... convert_grid ); - + end else - + if exist('time_of_day_in_hours','var') - - + + for j=1:length(time_of_day_in_hours) - + for k=1:length(run_months) - + get_model_and_obs_clim_stats( var_name, ... run_months{k}, exp_path, exp_run{n}, domain, ... start_year, end_year, ... dt_assim, t0_assim, species, obs_param, ... hscale, inc_ang, int_Asc, w_days, Ndata_min, prefix_out,... time_of_day_in_hours(j) ); - + end - + end - + else - + get_model_and_obs_clim_stats( var_name, ... run_months, exp_path, exp_run{n}, domain, start_year, end_year, ... dt_assim, t0_assim, species, obs_param, ... hscale, inc_ang, int_Asc, w_days, Ndata_min, prefix_out); - + end - + end end diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m similarity index 98% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m index 015f6762..20fc3832 100644 --- a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/Run_get_model_and_obs_clim_stats_latlon_grid.m @@ -5,7 +5,7 @@ % ------------------------------------------------------------------- % addpath('../../shared/matlab/'); -addpath('/discover/nobackup/amfox/current_GEOSldas/GEOSldas/src/Applications/LDAS_App/util/shared/matlab') +addpath('/discover/nobackup/amfox/current_GEOSldas/GEOSldas/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab') % Define the Open Loop experiment path, run name, domain, and output prefix @@ -33,7 +33,7 @@ grid_resolution = 0.25; -% Define moving window size over which statistics are calculated, +% Define moving window size over which statistics are calculated, % and minimum number of data points required to calculate statistics w_days = 75; @@ -68,20 +68,20 @@ for month = run_months % Initialize the earliest and latest year variables cnt = cnt + 1; - + % Check if the current year/month combination is earlier than the earliest if datenum(start_year, month, 1) < datenum(start_year, start_month, 1) earliest_year(cnt) = start_year+1; else earliest_year(cnt) = start_year; end - + % Check if the current year/month combination is later than the latest if datenum(end_year, month, 1) > datenum(end_year, end_month,1) latest_year(cnt) = end_year-1; else latest_year(cnt) = end_year; - end + end end % assume "ldas_obsparam" file is available at 0z on first day of start_month/start_year diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/dist_km2deg.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/dist_km2deg.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/dist_km2deg.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/dist_km2deg.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_ij_ind_from_latlon.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_ij_ind_from_latlon.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_ij_ind_from_latlon.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_ij_ind_from_latlon.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats_latlon_grid.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats_latlon_grid.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats_latlon_grid.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_model_and_obs_clim_stats_latlon_grid.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_tile_num_for_obs.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_tile_num_for_obs.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_tile_num_for_obs.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_tile_num_for_obs.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_tile_num_in_cell_ij.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_tile_num_in_cell_ij.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/get_tile_num_in_cell_ij.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/get_tile_num_in_cell_ij.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/write_netcdf_latlon_grid.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/write_netcdf_latlon_grid.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/write_netcdf_latlon_grid.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/write_netcdf_latlon_grid.m diff --git a/src/Applications/LDAS_App/util/inputs/obs_scaling_params/write_seqbin_file.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/write_seqbin_file.m similarity index 100% rename from src/Applications/LDAS_App/util/inputs/obs_scaling_params/write_seqbin_file.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/inputs/obs_scaling_params/write_seqbin_file.m diff --git a/src/Applications/LDAS_App/util/postproc/climatology/README b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/README similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/README rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/README diff --git a/src/Applications/LDAS_App/util/postproc/climatology/Run_L4_sm_clim_stats.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/Run_L4_sm_clim_stats.m similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/Run_L4_sm_clim_stats.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/Run_L4_sm_clim_stats.m diff --git a/src/Applications/LDAS_App/util/postproc/climatology/Write_L4_sm_clim_stat_bin2nc4.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/Write_L4_sm_clim_stat_bin2nc4.m similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/Write_L4_sm_clim_stat_bin2nc4.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/Write_L4_sm_clim_stat_bin2nc4.m diff --git a/src/Applications/LDAS_App/util/postproc/climatology/get_model_clim_stats.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/get_model_clim_stats.m similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/get_model_clim_stats.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/get_model_clim_stats.m diff --git a/src/Applications/LDAS_App/util/postproc/climatology/read_seqbin_clim_pctl_file.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/read_seqbin_clim_pctl_file.m similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/read_seqbin_clim_pctl_file.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/read_seqbin_clim_pctl_file.m diff --git a/src/Applications/LDAS_App/util/postproc/climatology/write_seqbin_clim_pctl_file.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/write_seqbin_clim_pctl_file.m similarity index 100% rename from src/Applications/LDAS_App/util/postproc/climatology/write_seqbin_clim_pctl_file.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/climatology/write_seqbin_clim_pctl_file.m diff --git a/src/Applications/LDAS_App/util/postproc/compress_bit-shaved_nc4.sh b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/compress_bit-shaved_nc4.sh similarity index 100% rename from src/Applications/LDAS_App/util/postproc/compress_bit-shaved_nc4.sh rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/compress_bit-shaved_nc4.sh diff --git a/src/Applications/LDAS_App/util/postproc/write_smapL4SMqa.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/write_smapL4SMqa.m similarity index 95% rename from src/Applications/LDAS_App/util/postproc/write_smapL4SMqa.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/write_smapL4SMqa.m index 7f510450..55be8d47 100644 --- a/src/Applications/LDAS_App/util/postproc/write_smapL4SMqa.m +++ b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/postproc/write_smapL4SMqa.m @@ -1,7 +1,7 @@ -function [] = write_smapL4SMqa( gph_aup_lmc_fnames, tilecoord_fname, tilegrids_fname ) +function [] = write_smapL4SMqa( gph_aup_lmc_fnames, tilecoord_fname, tilegrids_fname ) % THE FOLLOWING PATH SHOULD BE ADDED IN MATLAB SCRIPT THAT CALLS THIS FUNCTION -% add path to matlab functions in src/Applications/LDAS_App/util/shared/matlab/ +% add path to matlab functions in src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/ addpath('../shared/matlab/'); % Generate *.qa files from SMAP L4_SM "gph" or "aup" granules. @@ -47,7 +47,7 @@ % % lmcpath = [exppath, '/', expid, '/', expdom, '/rc_out/', ... % '/Y', yyyymm(1:4), '/M', yyyymm(5:6), '/']; -% +% % tcpath = [exppath, '/', expid, '/', expdom, '/rc_out/']; % % tc_fname = [tcpath, expid, '.ldas_tilecoord.bin']; @@ -82,7 +82,7 @@ % for ii=1:length(gphnames) % % fnames{ii} = [gphpath, gphnames{ii}]; -% +% % end % % ii_off = length(gphnames); @@ -90,13 +90,13 @@ % for ii=1:length(aupnames) % % fnames{ii+ii_off} = [auppath, aupnames{ii}]; -% +% % end % % ii_off = ii_off + length(aupnames); -% +% % fnames{ii_off+1} = [lmcpath, lmcname]; -% +% % write_smapL4SMqa( fnames, tc_fname, tg_fname ); % % ##################### END SAMPLE DRIVER SCRIPT ##################################### @@ -106,9 +106,9 @@ % make sure that list of input file names is a cell array if ~iscell(gph_aup_lmc_fnames) - + error('write_smapL4SMqa.m: input list of file names must be a cell array') - + end % ---------------------------------------------- @@ -130,33 +130,33 @@ % process each file in list of input files for ii=1:length(gph_aup_lmc_fnames) - + this_fname = gph_aup_lmc_fnames{ii}; - + disp(['processing: ', this_fname]) - + % parse input string name to decide whether a "gph" or "aup" granule is to be converted - - if any( findstr( this_fname , 'ldas_tile_xhourly_out' )) + + if any( findstr( this_fname , 'ldas_tile_xhourly_out' )) get_gph_qa( this_fname, tile_coord ); - + elseif any( findstr( this_fname , 'ldas_tile_inst_smapL4SMaup' )) - + get_aup_qa( this_fname, tile_coord ); - + elseif any( findstr( this_fname , 'ldas_smapL4SMlmc' )) - + get_lmc_qa( this_fname, tile_coord ); - + else - - error('write_smapL4SMqa.m: something wrong with input file name') - + + error('write_smapL4SMqa.m: something wrong with input file name') + end disp(['---------------------------------------------------------']) - + end @@ -184,10 +184,10 @@ % [QA] -- SMAP_L4_SM_PSD p.29: % % "... -% The QA file contains statistical information that will enable users -% to better assess the quality of the associated granule. +% The QA file contains statistical information that will enable users +% to better assess the quality of the associated granule. % QA products bear exactly the same name as the products [(.h5)] -% that they represent. The only difference in names is the extension. +% that they represent. The only difference in names is the extension. % The extension for all QA products is *.qa. % ..." % @@ -238,7 +238,7 @@ out_collection_ID = 6; -%N_out_fields = 40; % for raw LDASsa output (EXCL. sm in pctl units) +%N_out_fields = 40; % for raw LDASsa output (EXCL. sm in pctl units) N_out_fields = 42; % for post-processed LDASsa output (INCL. sm in pctl units) %==================================================================== @@ -268,7 +268,7 @@ % assemble placeholder h5 file name %%ind = findstr(gph_fname,'/'); - + %%h5_fname = [gph_fname(ind(end)+1:end-4), '.h5']; h5_fname = ''; @@ -288,7 +288,7 @@ fprintf(ofp, ['%s%8d\n\n'],... ['Number of L4_SM EASEv2 9 km land grid cells = '], N_gridcells_M09); -% comma-delimited table: +% comma-delimited table: % - 4 header lines (observation space) % - X variable lines % - footnotes @@ -307,7 +307,7 @@ end fprintf(ofp, '\n'); -for f = 1:Nstat+2 +for f = 1:Nstat+2 if f==1 fprintf(ofp, ['%-',str_f,'s',delim,''], [tablefields{f},'' ]); end if f==2 fprintf(ofp, ['%-',unt_f,'s',delim,''], [tablefields{f},' (*1)']); end if f==3 || f==4 fprintf(ofp, ['%', num_f,'s',delim,''], [tablefields{f},' (*2)']); end @@ -329,7 +329,7 @@ fprintf(ofp, tableformat_sc, ... fn{f}, units{f}, ... stats_array(tile_data(f,:)',weights, Nstat)); - + else fprintf(ofp, tableformat, ... @@ -344,17 +344,17 @@ for f = 1:str_l+1+unt_l+Nstat+(Nstat-1)*num_l+num_s_l fprintf(ofp, '%s','-' ); -end +end fprintf(ofp, '\n%s\n\n', ... 'See SMAP L4_SM Data Products Specification Document for additional information.'); fprintf(ofp, '%s\n', ... '(*1) Units are valid for all statistics except N [dimensionless].'); - + fprintf(ofp, '%s\n',... '(*2) Mean and std-dev statistics are weighted by the land fraction of each grid cell.'); - + fprintf(ofp, '%s\n', ... '(*3) N is the number of 9 km EASEv2 grid cells that contribute to the statistics.'); @@ -379,7 +379,7 @@ % - text edits, formatting % 4feb14: Gabrielle De Lannoy - new aup structure % 7feb14: Gabrielle De Lannoy - edits -% +% % - currently operates on binary LDASsa aup files % - TBD: file name change from "bin" to official "h5" granule name % @@ -388,10 +388,10 @@ % [QA] -- SMAP_L4_SM_PSD p.29: % % "... -% The QA file contains statistical information that will enable users -% to better assess the quality of the associated granule. +% The QA file contains statistical information that will enable users +% to better assess the quality of the associated granule. % QA products bear exactly the same name as the products [(.h5)] -% that they represent. The only difference in names is the extension. +% that they represent. The only difference in names is the extension. % The extension for all QA products is *.qa. % ..." % @@ -420,7 +420,7 @@ 'Mean','Std-dev','Min','Max','N'}; Nstat = length(tablefields)-2; - + str_l = 51; unt_l = 16; num_l = 13; @@ -445,7 +445,7 @@ tableformat_sc = [tableformat_sc, delim,'%',num_s_f,'d\n']; end end - + AmF_threshold(17:19) = 1E-5; % soil moisture AmF_threshold(20:21) = 1E-3; % temperature @@ -490,7 +490,7 @@ % assemble placeholder h5 file name %%ind = findstr(aup_fname,'/'); - + %%h5_fname = [aup_fname(ind(end)+1:end-4), '.h5']; h5_fname = ''; @@ -511,7 +511,7 @@ ['Number of L4_SM EASEv2 9 km land grid cells = '], N_gridcells_M09,... ['Number of L4_SM EASEv2 36 km land grid cells = '], N_gridcells_M36); -% comma-delimited table: +% comma-delimited table: % - 4 header lines (observation space) % - X variable lines % - footnotes @@ -533,7 +533,7 @@ end fprintf(ofp, '\n'); -for f = 1:Nstat+2 +for f = 1:Nstat+2 if f==1 fprintf(ofp, ['%-',str_f,'s',delim,''], [tablefields{f},' (*1)']); end if f==2 fprintf(ofp, ['%-',unt_f,'s',delim,''], [tablefields{f},' (*2)']); end if f==3 || f==4 fprintf(ofp, ['%', num_f,'s',delim,''], [tablefields{f},' (*3)']); end @@ -549,23 +549,23 @@ %-----Raw aup-fields---------------------------------------------- for f = 7:16 - + var = getfield(aup, fn{f}); var(abs(var-nodata_val) AmF_threshold(f); - + if f==17 subset_exclzero = tmp_subset; else - subset_exclzero = (subset_exclzero | tmp_subset); + subset_exclzero = (subset_exclzero | tmp_subset); end - + end %-----Raw aup-fields---------------------------------------------- for f = 17:length(fn) - + var = getfield(aup, fn{f}); var(abs(var-nodata_val) 0 || return_mean) - if return_mean + if return_mean array_out = NaN*zeros(length(ia),1); end @@ -1214,7 +1214,7 @@ if (std(array( ... M36_row_col(:,1) == unique_rc(i,1) & ... M36_row_col(:,2) == unique_rc(i,2) ))... - > stdv_Tbobs_tol) + > stdv_Tbobs_tol) N_bad = N_bad+1; end end @@ -1247,9 +1247,9 @@ % ********************************************************************************************* -function [ stats_out ] = stats_array( array_in, weights, Nstat ) +function [ stats_out ] = stats_array( array_in, weights, Nstat ) -% calculate elementary summary statistics for array_in +% calculate elementary summary statistics for array_in % % input: array_in = numerical array (1-dimensional) % weights = weight for each element in array_in (1-dimensional) @@ -1259,9 +1259,9 @@ % GDL, 16 Jan 2014 % GDL, 30 Jan 2014: remove NaN prior to the calculation of stats % GDL, 1 Feb 2014: - weighted statistics for mean and stdv -% - add 6th statistic (frac): +% - add 6th statistic (frac): % the actual used fraction of N_data (based on weights) -% GDL, 7 Feb 2014: added Nstat as input, to limit the returned output. +% GDL, 7 Feb 2014: added Nstat as input, to limit the returned output. % should be revised in the future to select specific output, % rather than to limit the output fields % --------------------------------------------------------------------- diff --git a/src/Applications/LDAS_App/util/shared/matlab/EASEv2_ind2latlon.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/EASEv2_ind2latlon.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/EASEv2_ind2latlon.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/EASEv2_ind2latlon.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/EASEv2_latlon2ind.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/EASEv2_latlon2ind.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/EASEv2_latlon2ind.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/EASEv2_latlon2ind.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/J2000_to_DateTime.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/J2000_to_DateTime.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/MAPL_ReadForcing_fullfile.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/MAPL_ReadForcing_fullfile.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/MAPL_ReadForcing_fullfile.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/MAPL_ReadForcing_fullfile.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/augment_date_time.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/augment_date_time.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/augment_date_time.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/augment_date_time.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/days_in_month.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/days_in_month.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/days_in_month.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/days_in_month.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/get_dofyr_pentad.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/get_dofyr_pentad.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/get_dofyr_pentad.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/get_dofyr_pentad.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/is_leap_year.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/is_leap_year.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/is_leap_year.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/is_leap_year.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/pentad_of_year.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/pentad_of_year.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/pentad_of_year.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/pentad_of_year.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_ObsFcstAna.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_ObsFcstAna.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_ObsFcstAna.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_ObsFcstAna.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_catparam.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_catparam.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_catparam.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_catparam.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_obslog.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_obslog.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_obslog.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_obslog.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_obsparam.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_obsparam.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_obsparam.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_obsparam.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_smapL4SMaup.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_smapL4SMaup.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_smapL4SMaup.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_smapL4SMaup.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_smapL4SMlmc.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_smapL4SMlmc.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_smapL4SMlmc.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_smapL4SMlmc.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_tilecoord.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_tilecoord.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_tilecoord.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_tilecoord.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/read_tilegrids.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_tilegrids.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/read_tilegrids.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/read_tilegrids.m diff --git a/src/Applications/LDAS_App/util/shared/matlab/tile2grid.m b/src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/tile2grid.m similarity index 100% rename from src/Applications/LDAS_App/util/shared/matlab/tile2grid.m rename to src/Components/GEOSldas_GridComp/GEOSldas_App/util/shared/matlab/tile2grid.m