/[MITgcm]/MITgcm/verification/aim.5l_cs/code/aim_external_fields_load.F
ViewVC logotype

Contents of /MITgcm/verification/aim.5l_cs/code/aim_external_fields_load.F

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


Revision 1.1.4.1 - (show annotations) (download)
Tue Feb 26 16:05:06 2002 UTC (22 years, 2 months ago) by adcroft
Branch: release1
CVS Tags: release1_p12_pre, release1_p12, release1_p13, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, release1_p8, release1_p9, release1_p2, release1_p3, release1_p4, release1_p6, release1_p7, release1_p13_pre, release1_p1, release1_chkpt44d_post, release1_p5
Branch point for: release1_50yr
Changes since 1.1: +2 -2 lines
Merging changes on MAIN between checkpoint43 and checkpoint43a-release1mods
Command: cvs -q update -jcheckpoint43 -jcheckpoint43a-release1mods -d -P

These changes are most of the changes between c43 and c44 except those
that occured after "12:45 11 Jan 2002". As far as I can tell it is
checkpoint43 with the following mods:

  o fix bug in mom_vi_del2uv
  o select when filters are applied ; add options to zonal_filter (data.zonfilt)  o gmredi: fix Pb in the adiabatic form ; add options (.e.g. Bolus advection)
  o update AIM experiments (NCEP input files)
  o improve and extend diagnostics (Monitor, TimeAve with NonLin-FrSurf)
  o added some stuff for AD
  o Jamar wet-points

This update does not contain the following mods that are in checkpoint44

  o bug fix in pkg/generic_advdiff/
    - thread related bug, bi,bj arguments in vertical advection routines
  o some changes to pkg/autodiff, pkg/cost, pkg/exf, pkg/ecco,
    verification/carbon and model/src/ related to adjoint
  o some new Matlab scripts for diagnosing model density
    - utils/matlab/dens_poly3.m and ini_poly3.m

The list of exclusions is accurate based on a "cvs diff". The list of
inclusions is based on the record in doc/tag-index which may not be complete.

1 C $Header: /u/gcmpack/MITgcm/verification/aim.5l_cs/code/aim_external_fields_load.F,v 1.1 2002/01/09 00:30:44 jmc Exp $
2 C $Name: checkpoint43a-release1mods $
3
4 #include "AIM_OPTIONS.h"
5
6 CStartOfInterface
7 SUBROUTINE AIM_EXTERNAL_FIELDS_LOAD(
8 I myTime, myIter, myThid )
9 C /==========================================================\
10 C | SUBROUTINE AIM_EXTERNAL_FIELDS_LOAD |
11 C | o Control reading of AIM fields from external source. |
12 C |==========================================================|
13 C | Loads bottom boundary condition datasets for AIM. |
14 C | The routine is called every timetep and periodically |
15 C | loads a set of external fields. |
16 C | Monthly climatology files are read for |
17 C | Albedo |
18 C | Soil moisture |
19 C | Land and sea surface temps. |
20 C | Most of the work is done by the master the thread while |
21 C | the other threads spin. |
22 C \==========================================================/
23 IMPLICIT NONE
24
25 C === Global variables ===
26 #include "SIZE.h"
27 #include "EEPARAMS.h"
28 #include "PARAMS.h"
29 #include "GRID.h"
30 #include "AIM_FFIELDS.h"
31
32 C === Routine arguments ===
33 C myThid - Thread no. that called this routine.
34 C myTime - Simulation time
35 C myIter - Simulation timestep number
36 INTEGER myThid
37 _RL myTime
38 INTEGER myIter
39 CEndOfInterface
40
41 C === Functions ===
42 LOGICAL DIFFERENT_MULTIPLE
43 EXTERNAL DIFFERENT_MULTIPLE
44
45 #ifdef ALLOW_AIM
46 C === Local variables ===
47 C bi,bj, i,j - Loop counters
48 C tYear - Fraction within year of myTime
49 C mnthIndex - Current time in whole months
50 C prevMnthIndex
51 C fNam - Strings used in constructing file names
52 C mnthNam
53 C pfact - used to convert Pot.Temp. to in-situ Temp.
54 INTEGER bi,bj, i, j
55 _RL pfact
56 REAL tYear
57 INTEGER mnthIndex
58 INTEGER prevMnthIndex
59 DATA prevMnthIndex / 0 /
60 SAVE prevMnthIndex
61 CHARACTER*17 fNam
62 CHARACTER*3 mnthNam(12)
63 DATA mnthNam /
64 & 'jan', 'feb', 'mar', 'apr', 'may', 'jun',
65 & 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' /
66 SAVE mnthNam
67 LOGICAL firstCall
68 DATA FirstCall /.TRUE./
69 SAVE FirstCall
70
71 C Prevent loading of new data before everyone has finished with it
72 CALL BAR2(myThid)
73
74 C Master thread coordinates loading of AIM datasets
75 _BEGIN_MASTER( myThid )
76
77 C Calculate offset into a year
78 tYear = myTime/(86400.*360.) -
79 & FLOAT(INT(myTime/(86400.*360.)))
80 mnthIndex = INT(tYear*12.)+1
81 IF ( mnthIndex .NE. prevMnthIndex .OR.
82 & FirstCall ) THEN
83 C New month so load in data
84 prevMnthIndex = mnthIndex
85 C o Albedo ( convert % to fraction )
86 WRITE(fNam,'(A,A,A)' ) 'salb.',mnthNam(mnthIndex),'.cs.bin'
87 CALL MDSREADFIELD(fNam(1:15),readBinaryPrec,'RS',1,
88 O aim_albedo,
89 I 1,myThid)
90
91 C o Surface temperature ( in kelvin )
92 WRITE(fNam,'(A,A,A)' ) 'stheta.',mnthNam(mnthIndex),'.cs.bin'
93 c WRITE(fNam,'(A,A,A)' ) 'tsurf.',mnthNam(mnthIndex),'.cs.bin'
94 CALL MDSREADFIELD(fNam(1:17),readBinaryPrec,'RS',1,
95 O aim_surftemp,
96 I 1,myThid)
97
98 C o Soil moisture
99 WRITE(fNam,'(A,A,A)' ) 'smoist.',mnthNam(mnthIndex),'.cs.bin'
100 CALL MDSREADFIELD(fNam(1:17),readBinaryPrec,'RS',1,
101 O aim_soilMoisture,
102 I 1,myThid)
103
104 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
105
106 C-- Converts fields for direct use in Atmos. Physics routine.
107 C better here rather than in "aim_do_atmos" since:
108 C a) change together conversion factor and input file name.
109 C b) conversion applied only 1 time / month ;
110 C c) easy to check here (variable in common).
111
112 DO bj=1,nSy
113 DO bi=1,nSx
114
115 C- Converts surface albedo : input data is in % 0-100
116 C and Francos package needs a fraction between 0-1
117 DO j=1,sNy
118 DO i=1,sNx
119 aim_albedo(I,J,bi,bj) = aim_albedo(I,J,bi,bj)/100.
120 ENDDO
121 ENDDO
122
123 C- Converts soil moisture (case input is in cm in bucket of depth 20cm.)
124 c DO j=1,sNy
125 c DO i=1,sNx
126 c aim_soilMoisture(I,J,bi,bj) = aim_soilMoisture(I,J,bi,bj)
127 c & /20.
128 c ENDDO
129 c ENDDO
130
131 C- Converts surface potential temp. to in-situ temperature :
132 DO j=1,sNy
133 DO i=1,sNx
134 pfact = (Ro_surf(i,j,bi,bj)/atm_po)**atm_kappa
135 aim_surftemp(i,j,bi,bj) = aim_surftemp(i,j,bi,bj)
136 & * pfact
137 ENDDO
138 ENDDO
139
140 C-- end bi,bj loops
141 ENDDO
142 ENDDO
143
144 IF (FirstCall)
145 & CALL WRITE_FLD_XY_RL('aim_Tsurf',' ',aim_surftemp,0,myThid)
146
147 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
148
149 ENDIF
150
151 FirstCall = .FALSE.
152 _END_MASTER( myThid )
153
154 C Stop anyone leaving until all data is read
155 CALL BAR2(myThid)
156
157 #endif /* ALLOW_AIM */
158
159 RETURN
160 END

  ViewVC Help
Powered by ViewVC 1.1.22