NOAA-GFDL / FMScoupler

Other
13 stars 55 forks source link

refactorization: simplify setting of Time_start and Time at nc=0 #116

Open mlee03 opened 6 months ago

mlee03 commented 6 months ago

In full coupler_main, Time at nc=0 and Time_init are set through a convoluted process in subroutine _couplerinit.

For Time at nc=0,

  1. Time = date where date is specified in the third line in the coupler.res file.
  2. If coupler.res does not exist or if the user specifies force_date_from_namelist=.True., Time = current_date where current_date is specified in the namelist.
  3. If _couplerinit is resorted to using current_date and current_date is not of appropriate value, mpp_error is called.

Initially, Time_init=date_init where date_init is specified in the second line of coupler.res. This value is eventually overwritten to be Tiime_init=base_date where base_date is specified in the _diagtable. If the base_year=0 from the _diagtable, date_init=date where date had been determined as above description.

Setting of Time and Time_init should be straightfoward and only method route should be available to the user. Refining the setting of Time and Time_init also opens up a chance to discuss the need of the coupler.res file.