Skip to content

snow/sea ice shortwave radiative transfer harmonization#63

Merged
akturner merged 176 commits intoMPAS-Dev:seaice/developfrom
chengdang:seaice/snowice_sw_snicar
Nov 14, 2018
Merged

snow/sea ice shortwave radiative transfer harmonization#63
akturner merged 176 commits intoMPAS-Dev:seaice/developfrom
chengdang:seaice/snowice_sw_snicar

Conversation

@chengdang
Copy link

This merge adds an optional subroutine to the snow-covered sea ice shortwave radiative transfer calculations that allows the snow to be treated the same to the land snow model (SNICAR). The same subroutine also improves the shortwave calculation of near-IR band for snow-covered sea ice with new parameterizations.

akturner and others added 30 commits October 27, 2017 14:43
Added get_domain to testing system.
This PR updates config flags/parameters and output biogeochemistry fields.
New namelist parameter, config_aggregate_halo_exch, to control use of aggregated halo exchanges
Most halo exchanges now have option to be aggregated
Removed multiple block test from test suite
Cleanup of a few namelist descriptions.
Added option for mpi_barriers before halo exchanges and timers around them
Added new namelist option config_load_balance_timers
…develop

Modify COMPASS scripts to be PEP8 compliant

The four main scripts that drive the COMPASS testing infrastructure were written with tabs, long lines and many other coding conventions that are discouraged in python. This merge ensures that the scripts are compliant with the PEP8 specification, as determined by the automatic code analysis within the spyder editor.

The following mode line (for vim) has been added to the bottom of each file:

# vim: foldmethod=marker ai ts=4 sts=4 et sw=4 ft=python
All empty except: clauses have been replaced with explicit exception names. Empty except clauses are considered a bad practice in python because (among other issues) even syntax errors in the code itself will be trapped by the except (a potential debugging nightmare).

With one exception, the scripts are expected to function identically before and after this merge. Only formatting changes for PEP8 compliance have been performed.

The exception is that support for the --verbose flag has been added to the cleanup phase of the manage_regression_suite.py script for consistency with the setup phase.

Copying of the environment in subprocess calls has been removed, as this is the default behavior.

Auto-generated scripts have been made PEP8 compliant to the extent possible. (The main PEP8 violations are that lines are often too long because of long strings that can not easily be broken into substrings.)
This fixes analysis members that currently write warnings on every call.
Added halo barriers after coupling and after halo exchange
Added option to turn off halo exchanges
@chengdang
Copy link
Author

@akturner I removed the files you mentioned and snicar_optics_5bnd_snow_and_aerosols.nc, and updated namelist.seaice and streams.seaice under directory: testing_and_setup/seaice/configurations/standard_physics/

config_calendar_type = 'gregorian_noleap'
config_start_time = '2000-01-01_00:00:00'
config_stop_time = 'none'
config_run_duration = '00-00-01_00:00:00'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't make unnecessary changes to pre-exisiting configurations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this change was made for model simulation. Revised

config_AM_timeSeriesStatsCustom_reset_intervals = '00-00-07_00:00:00'
config_AM_timeSeriesStatsCustom_backward_output_offset = '00-00-01_00:00:00'
/
&snicar_variables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in the "shortwave" namelist section

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

config_AM_timeSeriesStatsCustom_backward_output_offset = '00-00-01_00:00:00'
/
&snicar_variables
config_turn_snicar_system_on = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this config_use_snicar

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

possible_values="true or false"
/>
</nml_record>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessarly added blank line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

</var_struct>

<!-- Snicar 5-band optical property varables -->
<var_struct name="snicar_variables" time_levs="1" packages="pkgSnicarSystem">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename pool "snicar" from "snicar_variables"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

pondLidMeltFluxFraction(:,iCell), &
.false., &
lInitialization)
lInitialization, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excess spaces - fix formatting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

call MPAS_pool_get_subpool(block % structs, "initial", initial)
call MPAS_pool_get_subpool(block % structs, "velocity_solver", velocity_solver)


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove excess blank line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

call MPAS_pool_get_config(domain % configs, "config_scales_absorption_phaeocystis", config_scales_absorption_phaeocystis)
call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_proteins", config_ratio_C_to_N_proteins)


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove excess space

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@chengdang
Copy link
Author

Adrian, thanks for checking the code. Modified files have been pushed. Please check if there are more changes need to be made.

rewrote modified streams.seaice based off streams.seaice on master branch
Copy link
Collaborator

@akturner akturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pay attention to code formatting and ensure you keep indenting and general style the same as before.

&shortwave
config_shortwave_type = 'dEdd'
config_albedo_type = 'ccsm3'
config_use_snicar = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this set to true?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is set to false now

albedoIRDiffuseCategory, &
snowFractionCategory
snowFractionCategory,&
iceAsymmtryParameterDirect, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this formatting: extra spaces

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

brineFraction, &
modalBCabsorptionParameter, &
bioTracerShortwave
bioTracerShortwave, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

ext_cff_mss_ice_dfs ! snow mass extinction cross section (m2/kg)

real (kind=dbl_kind), dimension(:,:), intent(in) :: &
kaer_tab_5bd, & ! aerosol mass extinction cross section (m2/kg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be consistent with indenting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


logical (kind=log_kind), intent(in) :: &
use_snicar ! if true, use 5-band snicar IOPs for
! shortwave radiative calculation of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent formatting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed comment format

ext_cff_mss_ice_dfs ! snow mass extinction cross section (m2/kg)

real (kind=dbl_kind), dimension(:,:), intent(in) :: &
kaer_tab_5bd, & ! aerosol mass extinction cross section (m2/kg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistent indenting: keep original style

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

srftyp = 1
call compute_dEdd(nilyr, nslyr, klev, klevp, &

if (use_snicar) then ! use 5-band snicar IOPs for snow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formattign

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


if (use_snicar) then ! use 5-band snicar IOPs for snow

call compute_dEdd_5bd(nilyr, nslyr, klev, klevp, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

fswsfc, fswint, &
fswthru, Sswabs, &
Iswabs, fswpenl, &
asm_prm_ice_drc, asm_prm_ice_dfs, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@akturner akturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently doesn't run the test case without failure

call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid)

! snicar 5-band snow IOPs
call MPAS_pool_get_array(snicar_variables, "iceAsymmtryParameterDirect",iceAsymmtryParameterDirect)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

call MPAS_pool_get_array(snicar_variables, "aerosolSingleScatterAlbedo5band", aerosolSingleScatterAlbedo5band)
call MPAS_pool_get_array(snicar_variables,"aerosolAsymmetryParameter5band", aerosolAsymmetryParameter5band)
call MPAS_pool_get_array(snicar_variables, "modalMassExtinctionCrossSection5band", modalMassExtinctionCrossSection5band)
call MPAS_pool_get_array(snicar_variables,"modalSingleScatterAlbedo5band", modalSingleScatterAlbedo5band)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

call MPAS_pool_get_array(snicar_variables, "iceMassExtinctionCrossSectionDiffuse", iceMassExtinctionCrossSectionDiffuse)
call MPAS_pool_get_array(snicar_variables, "aerosolMassExtinctionCrossSection5band", aerosolMassExtinctionCrossSection5band)
call MPAS_pool_get_array(snicar_variables, "aerosolSingleScatterAlbedo5band", aerosolSingleScatterAlbedo5band)
call MPAS_pool_get_array(snicar_variables,"aerosolAsymmetryParameter5band", aerosolAsymmetryParameter5band)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting


! snicar 5-band snow IOPs
call MPAS_pool_get_array(snicar_variables, "iceAsymmtryParameterDirect",iceAsymmtryParameterDirect)
call MPAS_pool_get_array(snicar_variables, "iceAsymmtryParameterDiffuse",iceAsymmtryParameterDiffuse)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@chengdang
Copy link
Author

@akturner Hi, Thanks for checking it. Could you please send me the error log of your test run?

There are few things to note and I noticed when testing the current code:

  1. To run the modified code, you would need a new input file called

snicar_optics_5bnd_snow_and_aerosols.nc

which I will send to you via email shortly. This file contains the new input data for new features.

  1. In the run package distributed online (https://zenodo.org/record/1219191#.W86xJhNKiRs), MPAS-seaice aerosol input files are given as name

standard_optics_mpas_seaice.nc
snicar_optics_5bnd_mam_c140303_mpas_seaice.nc

while in MPAS-seaice code .../core_seaice/Registry.xml, these files are still named as

standard_optics_mpas_cice.nc
snicar_optics_5bnd_mam_c140303_mpas_cice.nc

So one would need to rename these files under run directory or change the source code for MPAS-seaice to read inputs.

  1. Test run with the streams.seaice generated from building MPAS-seaice leads to the following error log
 ----------------------------------------------------------------------
Beginning MPAS-seaice Error Log File for task       0 of       1
    Opened at 2018/10/22 22:09:37
----------------------------------------------------------------------

CRITICAL ERROR: MPAS-Ocean there are no fields in the time series stats output stream "timeSeriesStatsMonthlyOutput" that time series stats can be applied to.
Logging complete.  Closing file at 2018/10/22 22:09:37
  1. So I tested the codes with the above modifications 1 and 2 using my modified streams.seaice file (which I will send via email too), and it runs fine for one month test.

filename_interval="none"
input_interval="initial_only" />

<immutable_stream name="StandardAerosolsInput"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have these been added here? This now creates errors for the basic tests that dont involve this functionality,

Copy link
Author

@chengdang chengdang Nov 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I added this because these were added in the stream.cice file you shared with me last year, which was probably used for a more advanced version of MPAS-seaice? I have never done any tests with these since I don't have any aerosol input data, neither did I modify the codes related to these. The stream file I used also contain these (per email I sent on Oct 23rd), and I am able to run MPAS-seaice model without errors.

Would you like me to remove these for this model merge? If so, there will be no aerosol optical properties inputs for the solar radiative transfer calculation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please remove these. Theyre not needed for the base physics simulation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. They are removed.

@akturner
Copy link
Collaborator

akturner commented Nov 6, 2018

In answer to your questions above:

  1. Thanks!
  2. Thanks for letting me know - I will look at this.
  3. I will fix this, but generally this file shouldn't be used
  4. You might want to add a directory to configurations, called "snicar_shortwave" with a streams file and namelist that tests your functionality.

…streams file and namelist for snicar_shortwave test
@chengdang
Copy link
Author

Thanks! A directory (snicar_shortwave) with streams file and namelist is added to configurations for testing snicar related features.

filename_interval="none"
input_interval="initial_only" />

<immutable_stream name="SnicarInput"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isnt needed in this configuration. Please remove it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@akturner
Copy link
Collaborator

akturner commented Nov 8, 2018

Please add a README file to the snicar_shortwave configuration describing its unique features

…hysics

add README for configuration snicar_shortwave
@chengdang
Copy link
Author

README file is added to configuration snicar_shortwave

@akturner
Copy link
Collaborator

akturner commented Nov 9, 2018

Few more modifications:

  1. Add config_use_snicar = .false. to the appropriate place in the other namelists in the MPAS-Model/testing_and_setup/seaice/configurations/ directories
  2. Change the streams file in MPAS-Model/testing_and_setup/seaice/configurations/snicar_shortwave so that "forcing/" appears in front of the aerosol files since this is where they will be pulled automatically during testing
  3. Change the name of standard_optics_mpas_cice.nc in that streams file to standard_optics_mpas_seaice.nc since this is the name in the testing data set.

The snicar streams file should read:

<immutable_stream name="StandardAerosolsInput"
type="input"
filename_template="forcing/standard_optics_mpas_seaice.nc"
filename_interval="none"
input_interval="initial_only" />

<immutable_stream name="SnicarInput"
type="input"
filename_template="forcing/snicar_optics_5bnd_snow_and_aerosols.nc"
filename_interval="none"
input_interval="initial_only" />

@chengdang
Copy link
Author

Thanks Adrian. These are modified.


<immutable_stream name="SnicarInput"
type="input"
filename_template="forcing/snicar_optics_4bnd_snow_and_aerosols.nc"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not this be snicar_optics_5bnd_snow_and_aerosols.nc? Currently with the files I've been provided with this configuration fails because of this misnaming. Please test additions to PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Thanks for catching this typo. It is fixed.

@akturner akturner merged commit 187eae3 into MPAS-Dev:seaice/develop Nov 14, 2018
barlage pushed a commit to barlage/MPAS-Model that referenced this pull request Nov 6, 2024
…PAS-Dev#63)

function that will completely turn off transpiration at wilting point
soil moisture instead of allowing a very small transpiration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.