Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force a read of 'forcing' streams on init #10

Merged
merged 2 commits into from
Jul 15, 2021

Conversation

matthewhoffman
Copy link

Previously, input files used as time-varying forcing failed to be read
at the initial model time. This commit forces input streams with an
input_interval set to a time duration to be forced to be read at the
model initial time. They are read in the same we these "forcing" files
are read during timestepping by using the most recent previous time
level from the input file.

Previously, input files used as time-varying forcing failed to be read
at the initial model time.  This commit forces input streams with an
input_interval set to a time duration to be forced to be read at the
model initial time.  They are read in the same we these "forcing" files
are read during timestepping by using the most recent previous time
level from the input file.
@matthewhoffman matthewhoffman added the in progress Still being worked on, don't merge yet! label Jul 14, 2021
@matthewhoffman matthewhoffman requested a review from trhille July 15, 2021 01:43
@trhille
Copy link

trhille commented Jul 15, 2021

I tested this on Cori with the Humboldt Glacier r04 mesh and forcings. The code hangs before all input streams are read.
This is from the end of log.landice.0000.out:

WARNING: Variable basalWaterThickness not in input file.
WARNING: Variable waterFrac not in input file.
WARNING: Variable eigencalvingParameter not in input file.
WARNING: Variable stiffnessFactor not in input file.
WARNING: Variable calvingMask not in input file.
WARNING: Variable upliftRate not in input file.
WARNING: Variable effectivePressure not in input file.
WARNING: Variable basalFrictionFlux not in input file.
WARNING: Variable damage not in input file.
WARNING: Variable calvingVelocityData not in input file.
WARNING: Variable ismip6shelfMelt_basin not in input file.
WARNING: Variable ismip6shelfMelt_gamma0 not in input file.
WARNING: Variable ismip6shelfMelt_3dThermalForcing not in input file.
WARNING: Variable ismip6shelfMelt_deltaT not in input file.
WARNING: Variable ismip6shelfMelt_zOcean not in input file.
WARNING: Variable ismip6shelfMelt_offset not in input file.
WARNING: Variable ismip6Runoff not in input file.
WARNING: Variable ismip6_2dThermalForcing not in input file.
WARNING: Variable xtime not in input file.
WARNING: File /global/cfs/cdirs/piscees/MALI_input_files/Humboldt_1to10km_r04/Humboldt_1to10km_r04_20210617.nc does not contain a seekable xtime variable. Forcing a read of the first time record.
WARNING: Variable xtime not in input file.
WARNING: File /global/cscratch1/sd/trhille/Humboldt_1to10km_r04_20210617/Humboldt_1to10km_r04_20210617_muFriction_m7.nc does not contain a seekable xtime variable. Forcing a read of the first time record.

@matthewhoffman
Copy link
Author

@trhille , thanks for testing this. Can you send me the path to the full log and the streams file used?

@trhille
Copy link

trhille commented Jul 15, 2021

@trhille , thanks for testing this. Can you send me the path to the full log and the streams file used?

/global/cscratch1/sd/trhille/Humboldt_1to10km_r04_20210617/m7/MIROC5/testPR10

The new functionality now works as expected for a simple test.
@trhille
Copy link

trhille commented Jul 15, 2021

Testing after 6301c56 produced desired behavior and code did not hang. From log.landice.000.out:

` Finished reading 'initial_only' input streams.
Looking for recurring input streams (forcing) that should be forced to be read at the initial time.

  • Forced an initial read of input stream 'ismip6sfcMassBal' from time: 2007-07-01_00:00:00
  • Forced an initial read of input stream 'ismip6surfaceAirTemperature' from time: 2007-07-01_00:00:00
  • Forced an initial read of input stream 'ismip6_runoff' from time: 2007-07-01_00:00:00
  • Forced an initial read of input stream 'ismip6_2dThermalForcing' from time: 2007-07-01_00:00:00
  • Forced an initial read of input stream 'ismip6shelfMelt_3dThermalForcing' from time: 2007-07-01_00:00:00
    Finished processing recurring input streams at initial time.
    Using FO velocity solver.
    Initializing external velocity solver.
    Initializing external velocity solver grid data.
    Calculating N assuming perfect ocean connection.
    Initial timestep 2007-07-01_00:00:00
    Generating new external velocity solver FEM grid.
    Beginning velocity solve using external velocity solver.
    Completed velocity solve using external velocity solver.
    Starting timestep number 1
    Setting time step (days) to: 100.000000000000
    Starting face melt routine
    calling li_apply_front_ablation_velocity from grounded_face_melt_ismip6
    == Ablation complete. Total calved = 661178359.496096
    == Ablated from non-dynamic cells = 92101053.4246684
    == Ablated from dynamic cells = 263517186.514981
    == Stranded floating cells deleted = 361.393344835829
    == Unablated volumes: Non-dynamic cells=0.00000000000000; Dynamic cells=0.00000000000000
    Finished with li_apply_front_ablation_velocity
    basin=1, mean_TF=1.32037195650461
    iceshelf_melt_ismip6: gamma0=74628.5200000000
    Calculating N assuming perfect ocean connection.`

Copy link

@trhille trhille left a comment

Choose a reason for hiding this comment

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

Testing produces desired results. Ready to merge.

@matthewhoffman matthewhoffman merged commit d0c2867 into develop Jul 15, 2021
@matthewhoffman matthewhoffman removed the in progress Still being worked on, don't merge yet! label Oct 13, 2021
matthewhoffman added a commit to matthewhoffman/compass that referenced this pull request Apr 27, 2022
The ISMIP6 forcings are defined on July 1 of each year, and
at one point, there was an issue with reading forcings requiring that
the start time match the forcing time on init.  That problem was fixed
in MALI-Dev/E3SM#10 so we no longer need to
start in the middle of the year to use the ISMIP6 forcing.  To avoid
confusion, I'm changing all tests to starrt on 2007-01-01.

Also change all stream reference times to 2007-01-01.  This is not
necessary, because the default reference time of 0000-01-01 will yield
the same results.  But I'm changing it for explicitness.  A minor
conisderation is choosing a reference_time closer to the model clock
time should provide a very small improvement to the cost of timekeeping
operations related to i/o.
matthewhoffman added a commit to matthewhoffman/compass that referenced this pull request Apr 27, 2022
The ISMIP6 forcings are defined on July 1 of each year, and
at one point, there was an issue with reading forcings requiring that
the start time match the forcing time on init.  That problem was fixed
in MALI-Dev/E3SM#10 so we no longer need to
start in the middle of the year to use the ISMIP6 forcing.  To avoid
confusion, I'm changing all tests to starrt on 2007-01-01.

Also change all stream reference times to 2007-01-01.  This is not
necessary, because the default reference time of 0000-01-01 will yield
the same results.  But I'm changing it for explicitness.  A minor
conisderation is choosing a reference_time closer to the model clock
time should provide a very small improvement to the cost of timekeeping
operations related to i/o.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants