1 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_readparms.F,v 1.17 2007/03/13 14:04:36 molod Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FIZHI_OPTIONS.h" |
5 |
|
6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
7 |
CBOP 0 |
8 |
C !ROUTINE: FIZHI_MNC_INIT |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE FIZHI_READPARMS( myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C Read Fizhi Namelist and Get the Model Date and Time from File |
15 |
|
16 |
C !USES: |
17 |
implicit none |
18 |
|
19 |
#include "chronos.h" |
20 |
#include "SIZE.h" |
21 |
#include "fizhi_ocean_coms.h" |
22 |
#include "fizhi_io_comms.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
|
26 |
C !INPUT PARAMETERS: |
27 |
integer myThid |
28 |
CEOP |
29 |
|
30 |
C !LOCAL VARIABLES: |
31 |
character*(MAX_LEN_MBUF) msgBuf |
32 |
integer ku, ku2 |
33 |
integer nymdbegin, nhmsbegin |
34 |
integer nymdcurrent, nhmscurrent |
35 |
real runlength |
36 |
integer nincr |
37 |
integer mmdd,hhmmss,nsecf2 |
38 |
integer nymdend,nhmsend |
39 |
logical climsst, climsice |
40 |
|
41 |
namelist / fizhi_list / |
42 |
. nymdbegin, nhmsbegin, |
43 |
. fizhi_mnc_write_pickup, fizhi_mnc_read_pickup, |
44 |
. runlength, climsst, climsice |
45 |
|
46 |
C Set defaults |
47 |
fizhi_mdsio_read_pickup = .TRUE. |
48 |
fizhi_mdsio_write_pickup = .TRUE. |
49 |
fizhi_mnc_write_pickup = .FALSE. |
50 |
fizhi_mnc_read_pickup = .FALSE. |
51 |
runlength = 0.0 |
52 |
climsst = .TRUE. |
53 |
climsice = .TRUE. |
54 |
|
55 |
C Read Fizhi Namelist |
56 |
WRITE(msgBuf,'(A)') ' FIZHI_READPARMS: opening data.fizhi' |
57 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1) |
58 |
|
59 |
CALL OPEN_COPY_DATA_FILE('data.fizhi', 'FIZHI_READPARMS', |
60 |
& ku,myThid ) |
61 |
read (ku,NML=fizhi_list) |
62 |
close (ku) |
63 |
|
64 |
C Read Supplemental Ascii File with Current Time Info |
65 |
CALL MDSFINDUNIT( ku2, myThid ) |
66 |
open(ku2,file='datetime0',form='formatted') |
67 |
read(ku2,1000)nymdcurrent,nhmscurrent |
68 |
close (ku2) |
69 |
1000 format(i8,2x,i6) |
70 |
|
71 |
C Change the length of the model run, ie, change ntimesteps |
72 |
C if runlength has been set in the fizhi namelist |
73 |
|
74 |
if(runlength.gt.0.) then |
75 |
mmdd = int(runlength) |
76 |
hhmmss = int((runlength - int(runlength))*1.e6) |
77 |
if(mmdd.lt.100) then |
78 |
nincr = nsecf2(hhmmss,mmdd,nymdcurrent) |
79 |
else |
80 |
call time2freq2(mmdd,nymdcurrent,nhmscurrent,nincr) |
81 |
endif |
82 |
nTimeSteps = int(nincr/deltaT) |
83 |
nEndIter = nIter0 + nTimeSteps |
84 |
endTime = startTime + deltaT*float(nTimeSteps) |
85 |
WRITE(msgBuf,'(A,I10)') |
86 |
. ' CHANGING NUMBER OF MODEL TIMESTEPS TO',ntimesteps |
87 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1) |
88 |
WRITE(msgBuf,'(A,F12.2)') ' CHANGING END TIME TO',endtime |
89 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1) |
90 |
endif |
91 |
|
92 |
C Fill chronos Common Block with Namelist and Other File Info |
93 |
nymd0 = nymdbegin |
94 |
nhms0 = nhmsbegin |
95 |
nymd = nymdcurrent |
96 |
nhms = nhmscurrent |
97 |
|
98 |
C Fill ocean params common block with namelist into |
99 |
sstclim = climsst |
100 |
siceclim = climsice |
101 |
|
102 |
C Echo Date and Time Info |
103 |
_BEGIN_MASTER(myThid) |
104 |
print *, ' Begin Date ',nymd0,' Begin Time ',nhms0 |
105 |
print *, 'Current Date ',nymd,' Current Time ',nhms |
106 |
_END_MASTER(myThid) |
107 |
|
108 |
return |
109 |
end |
110 |
|
111 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |