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

ocean import fields are zero when initialized from coldstart run #86

Closed
DeniseWorthen opened this issue May 6, 2020 · 11 comments
Closed

Comments

@DeniseWorthen
Copy link
Collaborator

DeniseWorthen commented May 6, 2020

The current implementation of S2S uses a 1 hour cold start followed by a restart from the cold start. For ease of description, these will be referred to as 'cold1' and 'cold2' below.

Using the NEMS mediator, the cold2 run is initializing the import state for the ocean with all zero fields. This is can be verified by running ufs-s2s-model with field dumping active. For the cold2 run, all fields in the fields_ocn_import_(DATE)T00:00:00.nc are zero.

This behaviour is the result of the prep_ocn phase zero-ing the accumulation fields and accumulation counters at the end of the phase. The mediator restart files produced by the cold1 run (mediator_FBaccumAtm_restart.*, mediator_FBaccumAtmOcn_restart.nc, mediator_FBaccumIce_restart.nc) and the accumulation counts (mediator_scalars_restart.txt) all contain zeros as a result.

When the cold2 run starts, the prep_ocn at the top of the run sequence averages these accumulation fields (ie, divides by the accumulation count) to create the import fields for the ocean. Since the fields are zero as well as the counts, the import fields at time 00:00:00 are also zero.

This behaviour is replicated in the current CMEPS implmentation. However, in CMEPS, the presence of a separate accum_avg phase (where the accumulations are zero'd) and restart_write phase allows the run sequence to be adjusted to produce valid (non-zero) mediator restarts for cold1. This involves placing the med_phases_restart_write before of the med_phases_prep_ocn_accum_avg in the cmeps cold1 run sequence.

For the NEMS mediator, this same change cannot be accomplished without separating out the accumulation-related calls from prep_ocn.

A secondary issue w/rt the current cold1/cold2 sequence is that cold1 is at the end of 2 ocean coupling steps. Even if the mediator restarts contain non-zero values (ie, as can be accomplished with CMEPS), this would seemingly result in import fields for the ocean at time 00:00:00 that are in some sense forward by a coupling timestep relative to the ATM and ICE.

An alternative to the cold1/cold2 sequence may be to implement an ocean lag startup. In this case, only the cold2 sequence is implemented but a special setting is used so that the ocean model does not advance on the first coupling timestep. Instead, the ocean model clock is set back to the start time. On the second coupling timestep, the ocean model advances for 2 coupling timesteps. For example, if the coupling timestep is 30 minutes and the internal ocean timesteps are 30 mins (thermo) and 15 mins (dynamic), the model will step forward 2 thermo dynamic timesteps and 4 dynamic timesteps. All subsequent coupling timesteps for the ocean model proceed as normal.

@SMoorthi-emc
Copy link
Collaborator

SMoorthi-emc commented May 6, 2020 via email

@SMoorthi-emc
Copy link
Collaborator

SMoorthi-emc commented May 6, 2020 via email

@DeniseWorthen
Copy link
Collaborator Author

Update this issue to include next steps:

  1. If the CMEPS mediator fields are zero, we need to fix the order of writing restart files. If CMEPS mediator has valid values (non-zero) in restart files, we need to make sure the average fields are passed to ocean correctly in the first time step.

  2. If CMEPS mediator has valid values (non-zero) in restart files, we need to make sure the average fields are passed to ocean correctly in the first time step.

@DeniseWorthen
Copy link
Collaborator Author

I added a state_diagnose function to the mom6 nuopc cap and turned on the FB_diagnose in mep_phases_prep_ocn_avg. Using these two features, I have verified that:

  1. Using the existing cold start procedure produces ocean import fields of 0.0 for the first ocean coupling timestep when restarting from coldstart.

  2. Moving the restart write to earlier in the cold run sequence (as suggested by @mvertens) produces non-zero import fields for the ocean at the first coupling timestep.

  3. Using the FV3 fix provided by @junwang-noaa to provide the bottom-most atm values to the ice at the first coupling timestep and using an ocean-lag for the first ocean coupling timestep allows the model to run in a concurrent run sequence from ICs with no cold start mediator file required.

Three test cases corresponding to these items were made. At hour 6, the difference in SST from the initial MOM6 SST for the three cases is shown:

sst_diffs

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Aug 3, 2020 via email

@DeniseWorthen
Copy link
Collaborator Author

Yes, my test cases are on Cheyenne and I ran 48 hours. Do you want the ocean lag SST (case3)- cold start SST (case1) at 48 hours?

The ocean lag is only on the first coupling timestep. On the first coupling timestep, the ocean does not advance. On the second coupling timestep, MOM6 advances by two timesteps. After that, MOM6 advances normally.

The relevant code can be seen LN 1382

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Aug 3, 2020 via email

@DeniseWorthen
Copy link
Collaborator Author

Runtype is set in the mom_cap at InitializeAdvertise. It is read from nems.configure from the variable "start_type". For non-cesm, it will be set as "initial".

We are currently not really making use of the start_type variable since our set up uses the namelists of components to set whether we're doing an initial vs continue run. We do need to be careful during actual model restarts ("warm start") that we make consistent use of runtype.

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Aug 3, 2020 via email

@DeniseWorthen
Copy link
Collaborator Author

This is the SST difference at 48 hours for the 20120101 ICS between using the ocean lag and using the original cold start mediator file.

sst_diffs_48h

DeniseWorthen added a commit that referenced this issue Sep 8, 2020
* Replaces CICE5 with CICE6: Issue #159 

* Adds required  CICE6 items to nems.configure. Removes non-cmeps nems.configure files. Updates default_vars and edit_inputs to allow CICE6 resolution and processor count to be specified at run time. Updates ice_in_template for CICE6

* Updates to esmf8.1.0bs27 to allow ICE and WAV on separate PEs (Issue #172)

* Adds cpl_mode (Issue #138) and use_coldstart as new configurable variables (Issues #86, #53). 

* Fixes coldstart run sequence by calling the restart write phase before the accum avg phase (Issue #167)
@DeniseWorthen
Copy link
Collaborator Author

Closing; this issue is resolved by the commit of the 1step coldstart PR #187

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

No branches or pull requests

3 participants