Opened 7 years ago
Closed 7 years ago
#759 closed upgrade (Done)
Miscelaneous Update: Date Clock, Calendar, makefile, build script
Reported by: | arango | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.7 |
Component: | Nonlinear | Version: | 3.7 |
Keywords: | Cc: |
Description
Minor update to several files:
- Updated routines calendar and ref_clock of module dateclock.F for the computation of the 360DAY calendar (time_ref=-1). It has a year length of 360 days and every month has 30 days:
In this calendar, the time in days is simply:
TimeInDays = year * 360 + (month - 1) * 30 + (day - 1)
And its inverse:
year = INT(TimeInDays / 360) yday = INT((TimeInDays - year * 360) + 1) month = INT(((yday - 1) / 30) + 1) day = MOD(yday - 1, 30) + 1
In the above equations, the origin (TimeInDays=0) corresponds to 01-Jan-000. However, historically ROMS assumed that TimeInDays=1 corresponded to 01-Jan-0000 instead. So there is a one-day shift when compared with third-party software (like ESMF). The equations can be manipulated to give either origin, but it is confusing. Since the above equations are simpler, effective immediately the origin (TimeInDays=0) occurs on 01-Jan-0000. Therefore, to guarantee compatibility with previous ROMS solutions and datasets with this climatological calendar, the reference date is changed to
'time-units since 0000-12-30 00:00:00'
to fix the one-day shift.
- Updated routines datenum and datevec of module dateclock.F to be consitent with the Matlab version of these functions. For simplicity, the equations coded in ROMS assumed that the origin (datenum=0) occurs on 01-Mar-0000 while in Matlab occurs on 00-00-0000:
Matlab: datenum(0000,00,00)=0 reference date datenum(0000,01,01)=1 ROMS: datenum(0000,03,01)=0 refecence date: Mar 1, 0000 ! datenum(0000,01,01)=-59
To avoid confusion, an offset of 61 days is added to match Matlab datenum function. The difference between 0000-00-00 00:00:00 and 0000-03-01 00:00:00 is 61 days.
- Updated makefile to use cleaner logical test statements:
ifneq ($(MAKECMDGOALS),clean) -include $(SCRATCH_DIR)/MakeDependend endif instead of ifneq "$(MAKECMDGOALS)" "clean" -include $(SCRATCH_DIR)/MakeDependend endif
- Added a new option -p ot the build.sh and build.bash compiling scripts to print any macro of the compilation:
# Usage: ::: # ::: # ./build.sh [options] ::: # ::: # Options: ::: # ::: # -j [N] Compile in parallel using N CPUs ::: # omit argument for all available CPUs ::: # ::: # -p macro Prints any Makefile macro value. For example, ::: # ::: # build.sh -p FFLAGS ::: # ::: # -noclean Do not clean already compiled objects :::
- Added an extra argument Mgrids to function load_s2d of file inp_par.F to the number of nested grids in a application to allow coupling to other DATA model in the future:
FUNCTION load_s2d (Nval, Fname, Fdim, line, label, ifile, igrid, & & Mgrids, Nfiles, Ncount, idim, S)
Notice that in read_phypar.F now we have:
CASE ('FRCNAME') label='FRC - forcing fields' Npts=load_s2d(Nval, Cval, Cdim, line, label, ifile, & & igrid, Ngrids, nFfiles, Ncount, max_Ffiles, & & FRC)