1 |
heimbach |
1.1 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
|
|
#include "EBM_OPTIONS.h" |
4 |
|
|
|
5 |
|
|
SUBROUTINE EBM_READPARMS( myThid ) |
6 |
|
|
C /==========================================================\ |
7 |
|
|
C | SUBROUTINE EBM_READPARMS | |
8 |
|
|
C | o Routine to read in file data.ebm | |
9 |
|
|
C \==========================================================/ |
10 |
|
|
IMPLICIT NONE |
11 |
|
|
|
12 |
|
|
C === Global variables === |
13 |
|
|
#include "SIZE.h" |
14 |
|
|
#include "EEPARAMS.h" |
15 |
|
|
#include "PARAMS.h" |
16 |
|
|
#include "GRID.h" |
17 |
|
|
#ifdef ALLOW_EBM |
18 |
|
|
#include "EBM.h" |
19 |
|
|
#endif |
20 |
|
|
|
21 |
|
|
C === Routine arguments === |
22 |
|
|
C myThid - Number of this instance |
23 |
|
|
INTEGER myThid |
24 |
|
|
|
25 |
|
|
#ifdef ALLOW_EBM |
26 |
|
|
|
27 |
|
|
C === Local variables === |
28 |
|
|
C msgBuf - Informational/error meesage buffer |
29 |
|
|
C errIO - IO error flag |
30 |
|
|
C iUnit - Work variable for IO unit number |
31 |
|
|
|
32 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
33 |
|
|
INTEGER errIO, iUnit |
34 |
|
|
|
35 |
|
|
C-- Namelist |
36 |
|
|
NAMELIST /EBM_PARM01/ |
37 |
|
|
& tauThetaZonRelax, lambdaThetaZonRelax, |
38 |
|
|
& scale_runoff, |
39 |
|
|
& RunoffFile |
40 |
|
|
|
41 |
|
|
_BEGIN_MASTER(myThid) |
42 |
|
|
|
43 |
|
|
WRITE(msgBuf,'(A)') ' ebm_readparms: opening data.ebm' |
44 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
45 |
|
|
& SQUEEZE_RIGHT , 1) |
46 |
|
|
|
47 |
|
|
CALL OPEN_COPY_DATA_FILE( |
48 |
|
|
I 'data.ebm', 'ebm_readparms', |
49 |
|
|
O iUnit, myThid ) |
50 |
|
|
|
51 |
|
|
C-- set default |
52 |
|
|
tauThetaZonRelax = 0. |
53 |
|
|
lambdaThetaZonRelax = 0. |
54 |
|
|
scale_runoff = 1. |
55 |
|
|
RunoffFile = ' ' |
56 |
|
|
|
57 |
|
|
C----------------------------------------------------------------------- |
58 |
|
|
|
59 |
|
|
C-- Read settings from model parameter file "data.ebm". |
60 |
|
|
READ(UNIT=iUnit,NML=EBM_PARM01,IOSTAT=errIO) |
61 |
|
|
IF ( errIO .LT. 0 ) THEN |
62 |
|
|
WRITE(msgBuf,'(A)') |
63 |
|
|
& 'S/R ebm_readparms' |
64 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
65 |
|
|
WRITE(msgBuf,'(A)') |
66 |
|
|
& 'Error reading numerical model ' |
67 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
68 |
|
|
WRITE(msgBuf,'(A)') |
69 |
|
|
& 'parameter file "data.ebm"' |
70 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
71 |
|
|
WRITE(msgBuf,'(A)') |
72 |
|
|
& 'Problem in namelist EBM_PARM01' |
73 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
74 |
|
|
C CALL MODELDATA_EXAMPLE( myThid ) |
75 |
|
|
STOP 'ABNORMAL END: S/R ebm_readparms' |
76 |
|
|
ENDIF |
77 |
|
|
|
78 |
|
|
CLOSE(iUnit) |
79 |
|
|
|
80 |
|
|
WRITE(msgBuf,'(A)') ' ebm_readparms: finished reading data.ebm' |
81 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
82 |
|
|
& SQUEEZE_RIGHT , 1) |
83 |
|
|
|
84 |
|
|
IF ( tauThetaZonRelax .NE. 0. _d 0 ) THEN |
85 |
|
|
lambdaThetaZonRelax = 1./tauThetaZonRelax |
86 |
|
|
ENDIF |
87 |
|
|
|
88 |
|
|
_END_MASTER(myThid) |
89 |
|
|
|
90 |
|
|
C-- Everyone else must wait for the parameters to be loaded |
91 |
|
|
_BARRIER |
92 |
|
|
|
93 |
|
|
#endif /* ALLOW_EBM */ |
94 |
|
|
|
95 |
|
|
return |
96 |
|
|
end |