/[MITgcm]/MITgcm/model/src/load_ref_files.F
ViewVC logotype

Contents of /MITgcm/model/src/load_ref_files.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Wed Dec 22 00:05:31 2010 UTC (13 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint63, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.1: +10 -82 lines
read grid-spacing and ref.profile using S/R READ_GLVEC_RL.

1 C $Header: /u/gcmpack/MITgcm/model/src/load_ref_files.F,v 1.1 2008/09/05 20:15:28 jmc Exp $
2 C $Name: $
3
4 c #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: LOAD_REF_FILES
9 C !INTERFACE:
10 SUBROUTINE LOAD_REF_FILES( myThid )
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE LOAD_REF_FILES
14 C | o Read reference vertical profile from files
15 C | (Pot.Temp., Salinity/Specif.Humid., density ... )
16 C *==========================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21 C === Global variables ===
22 #include "SIZE.h"
23 #include "EEPARAMS.h"
24 #include "PARAMS.h"
25 c #include "GRID.h"
26
27 C !INPUT/OUTPUT PARAMETERS:
28 C == Routine arguments ==
29 C myThid :: my Thread Id number
30 INTEGER myThid
31
32 C !FUNCTIONS:
33 INTEGER ILNBLNK
34 EXTERNAL ILNBLNK
35
36 C !LOCAL VARIABLES:
37 C == Local variables ==
38 C k :: loop index
39 C msgBuf :: Informational/error message buffer
40 _RL tracerDefault
41 INTEGER k, kLen
42 CHARACTER*(MAX_LEN_MBUF) msgBuf
43 CEOP
44
45 _BEGIN_MASTER( myThid )
46
47 C-- Set reference Potential Temperature
48 IF ( tRefFile .EQ. ' ' ) THEN
49 C- set default vertical profile for temperature: tRef
50 tracerDefault = 20.
51 IF ( fluidIsAir ) tracerDefault = 300.
52 DO k=1,Nr
53 IF (tRef(k).EQ.UNSET_RL) tRef(k) = tracerDefault
54 tracerDefault = tRef(k)
55 ENDDO
56 ELSE
57 C- check for multiple definitions:
58 DO k=1,Nr
59 IF (tRef(k).NE.UNSET_RL) THEN
60 WRITE(msgBuf,'(2A,I4,A)') 'S/R LOAD_REF_FILES:',
61 & ' Cannot set both tRef(k=', k, ') and tRefFile'
62 CALL PRINT_ERROR( msgBuf, myThid )
63 STOP 'ABNORMAL END: S/R INI_PARMS'
64 ENDIF
65 ENDDO
66 ENDIF
67 C- read from file:
68 IF ( tRefFile .NE. ' ' ) THEN
69 kLen = ILNBLNK(tRefFile)
70 CALL READ_GLVEC_RL( tRefFile, ' ', tRef, Nr, 1, myThid )
71 WRITE(msgBuf,'(3A)') 'S/R LOAD_REF_FILES:',
72 & ' tRef loaded from file: ', tRefFile(1:kLen)
73 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
74 & SQUEEZE_RIGHT , myThid )
75 ENDIF
76
77 C-- Set reference Salinity/Specific Humidity
78 IF ( sRefFile .EQ. ' ' ) THEN
79 C- set default vertical profile for salinity/water-vapour: sRef
80 tracerDefault = 30.
81 IF ( fluidIsAir ) tracerDefault = 0.
82 DO k=1,Nr
83 IF (sRef(k).EQ.UNSET_RL) sRef(k) = tracerDefault
84 tracerDefault = sRef(k)
85 ENDDO
86 ELSE
87 C- check for multiple definitions:
88 DO k=1,Nr
89 IF (sRef(k).NE.UNSET_RL) THEN
90 WRITE(msgBuf,'(2A,I4,A)') 'S/R LOAD_REF_FILES:',
91 & ' Cannot set both sRef(k=', k, ') and sRefFile'
92 CALL PRINT_ERROR( msgBuf, myThid )
93 STOP 'ABNORMAL END: S/R INI_PARMS'
94 ENDIF
95 ENDDO
96 ENDIF
97 C- read from file:
98 IF ( sRefFile .NE. ' ' ) THEN
99 kLen = ILNBLNK(sRefFile)
100 CALL READ_GLVEC_RL( sRefFile, ' ', sRef, Nr, 1, myThid )
101 WRITE(msgBuf,'(3A)') 'S/R LOAD_REF_FILES:',
102 & ' sRef loaded from file: ', sRefFile(1:kLen)
103 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
104 & SQUEEZE_RIGHT , myThid )
105 ENDIF
106
107 C-- Set reference Density
108 IF ( rhoRefFile .NE. ' ' ) THEN
109 kLen = ILNBLNK(rhoRefFile)
110 C- read from file:
111 CALL READ_GLVEC_RL( rhoRefFile, ' ', rho1Ref, Nr, 1, myThid )
112 WRITE(msgBuf,'(3A)') 'S/R LOAD_REF_FILES:',
113 & ' rho1Ref loaded from file: ', rhoRefFile(1:kLen)
114 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
115 & SQUEEZE_RIGHT , myThid)
116 ENDIF
117
118 _END_MASTER(myThid)
119 C-- Everyone else must wait for the parameters to be loaded
120 _BARRIER
121
122 RETURN
123 END

  ViewVC Help
Powered by ViewVC 1.1.22