1 |
cnh |
1.1 |
C /---------------------------------------------------------------\ |
2 |
|
|
C |+| MIT General Circulation Modeling Package (GCMPACK) |+| |
3 |
|
|
C |+| |+| |
4 |
|
|
C |+| Copyright (c) 1993, 1994, 1995, 1996, 1997 |+| |
5 |
|
|
C |+| |+| |
6 |
|
|
C |+| All rights reserved |+| |
7 |
|
|
C |+| |+| |
8 |
|
|
C |+| This software is provided with absolutely NO WARRANTY. |+| |
9 |
|
|
C |+| |+| |
10 |
|
|
C |+| Permission is given to use this software for any |+| |
11 |
|
|
C |+| non-commercial purpose provided that |+| |
12 |
|
|
C |+| o Publications acknowledge any use of GCMPACK. |+| |
13 |
|
|
C |+| o Alterations to the software are made freely and |+| |
14 |
|
|
C |+| unconditionally available to all and any of GCMPACK |+| |
15 |
|
|
C |+| authors without prejudice. |+| |
16 |
|
|
C |+| |+| |
17 |
|
|
C |+| All other uses, including redistribution in whole or |+| |
18 |
|
|
C |+| in part, are forbidden. |+| |
19 |
|
|
C |+| |+| |
20 |
|
|
C |+| Chris Hill cnh@plume.mit.edu |+| |
21 |
|
|
C \---------------------------------------------------------------/ |
22 |
|
|
C |
23 |
|
|
C /---------------------------------------------------------------\ |
24 |
|
|
C ||| ************************************************** ||| |
25 |
|
|
C ||| * General Circulation Modeling Package (GCMPACK) * ||| |
26 |
|
|
C ||| ************************************************** ||| |
27 |
|
|
C ||| ||| |
28 |
|
|
C ||| MIT Ocean-Atmosphere Circulation Model 1.0 Alpha ||| |
29 |
|
|
C ||| ================================================ ||| |
30 |
|
|
C ||| ||| |
31 |
|
|
C ||| Multithreaded Implementation of the MIT ||| |
32 |
|
|
C ||| Ocean-Atmosphere Circulation Model. ||| |
33 |
|
|
C ||| This model is a general purpose numerical engine that ||| |
34 |
|
|
C ||| can be used in the study of a wide range of oceaninc ||| |
35 |
|
|
C ||| and atmospheric phenomena. The model uses the pressure||| |
36 |
|
|
C ||| method to simulate non-hydrostatic (NH), ||| |
37 |
|
|
C ||| quasi-hydrostatic (QH) and hydrostatic (HY) fluid ||| |
38 |
|
|
C ||| flows in a rotating frame of reference using a ||| |
39 |
|
|
C ||| grid-point finite volume discretization. The algorithm||| |
40 |
|
|
C ||| is described in ||| |
41 |
|
|
C ||| "..." ||| |
42 |
|
|
C ||| "..." ||| |
43 |
|
|
C ||| The implmentation here is based on the algorithm laid ||| |
44 |
|
|
C ||| out in the above references. This implementation ||| |
45 |
|
|
C ||| employs a regular grid and can be applied directly to ||| |
46 |
|
|
C ||| either cartesian or spherical polar frameworks. ||| |
47 |
|
|
C \---------------------------------------------------------------/ |
48 |
|
|
C $Id: main.F,v 1.22 1997/06/10 17:46:06 cnh Exp $ |
49 |
|
|
C |
50 |
|
|
C Baseline Program Structure |
51 |
|
|
C ========================== |
52 |
|
|
C MAIN |
53 |
|
|
C |----CONTROL |
54 |
|
|
C |---- SET_DEFAULTS Set default values for model parameters. |
55 |
|
|
C | |-- DATE Record date and time of run. |
56 |
|
|
C | |-- PLTFRM Record machine identfying string. |
57 |
|
|
C | |
58 |
|
|
C |---- READ_DATA Read data file specifying model parameters. |
59 |
|
|
C | |-- READ_TOPOGRAPHY Read land/water map. |
60 |
|
|
C | |
61 |
|
|
C |---- INITIALISE |
62 |
|
|
C | |-- INITIALISE_MASKS Set land/water mask arrays. |
63 |
|
|
C | |-- INITIALISE_DENSITY Calculate reference densities. |
64 |
|
|
C | | |-- RHO_LOCAL |
65 |
|
|
C | | |
66 |
|
|
C | |-- INITIALISE_GRIDDING Set up arrays expressing geometry. |
67 |
|
|
C | | |-- INITIALISE_CARTESIAN_GRID |
68 |
|
|
C | | |-- INITIALISE_SPEHERICAL_POLAR_GRID |
69 |
|
|
C | | |
70 |
|
|
C | |-- INITIALISE_OPERATORS Set up differencing operators. |
71 |
|
|
C | | |-- CG2DAI Define 2d laplacian "A matrix" operator. |
72 |
|
|
C | | |-- CG2DPI Define 2d "A matrix" preconditioner. |
73 |
|
|
C | | |
74 |
|
|
C | |-- INITIALISE_CORIOLIS Set Coriolis term operator. |
75 |
|
|
C | |-- INITIALISE_FIELDS Set initial values of model variables. |
76 |
|
|
C | |-- INITIALISE_U |
77 |
|
|
C | |-- INITIALISE_V |
78 |
|
|
C | |-- INITIALISE_S |
79 |
|
|
C | |-- INITIALISE_T |
80 |
|
|
C | |-- DUMP_READ2D Read XY field values from files. |
81 |
|
|
C | | |-- DUMP_IO2D |
82 |
|
|
C | | |
83 |
|
|
C | |-- DUMP_READ Read 3d field values from files. |
84 |
|
|
C | |-- DUMP_IO3D |
85 |
|
|
C | |
86 |
|
|
C |---- PRINT_HEADING Print out run data summary page. |
87 |
|
|
C | |
88 |
|
|
C |---- MODEL Perform integration. |
89 |
|
|
C |-- RHO_CALC Evaluate initial density. |
90 |
|
|
C MAIN LOOP ------> | |
91 |
|
|
C |-- LOAD_FORCING Read in external forcing data. |
92 |
|
|
C |-- GVEL_CALC Calculate explicit tendencies for u, v and w. |
93 |
|
|
C |-- PFIND Diagnose pressure field. |
94 |
|
|
C | |-- CG2D 2d preconditioned conjgrad solver |
95 |
|
|
C | (used to solve for surface pressure). |
96 |
|
|
C |-- UPDATE_UV Step forward lateral velocity. |
97 |
|
|
C |-- UPDATE_W Step forward (NH or QH) w, or diagnose from continuity |
98 |
|
|
C | (NH, QH or HY). |
99 |
|
|
C |-- GT_CALC Calculate tendency for temperature. |
100 |
|
|
C |-- UPDATE_T Step forward temperature. |
101 |
|
|
C |-- GS_CALC Calculate tendency for salinity. |
102 |
|
|
C |-- UPDATE_S Step forward salinity. |
103 |
|
|
C |-- CADJUST Mix unstable water column ( coarse resolution ). |
104 |
|
|
C |-- UPDATE_RHO Diagnose new density field. |
105 |
|
|
C TO MAIN LOOP <---- |-- OUT Dump out model fields. |
106 |
|
|
#include "CPP_OPTIONS.h" |
107 |
|
|
#include "CPP_MACROS.h" |
108 |
|
|
IMPLICIT NONE |
109 |
|
|
C To avoid problems on certain platforms always declare *ALL* COMMON blocks in |
110 |
|
|
C main. |
111 |
|
|
C ======== Global data ============================ |
112 |
|
|
#include "SIZE.h" |
113 |
|
|
#include "OPERATORS.h" |
114 |
|
|
#include "GRID.h" |
115 |
|
|
#include "PARAMS.h" |
116 |
|
|
#include "OLDG.h" |
117 |
|
|
#include "MASKS.h" |
118 |
|
|
#include "CG2DA.h" |
119 |
|
|
#include "CG2DZ.h" |
120 |
|
|
#include "AJAINF.h" |
121 |
|
|
#include "FORCING.h" |
122 |
|
|
#include "POLYEOS.h" |
123 |
|
|
C ========== Special code for getting Sun compatible binary data |
124 |
|
|
C ========== on a CRAY |
125 |
|
|
INTEGER ier |
126 |
|
|
#ifdef CRAY_SUNBIN |
127 |
|
|
CALL ASSIGN('assign -O -F f77 -N ieee g:su',ier) |
128 |
|
|
CALL ASSIGN('assign -O -F f77 -N ieee g:du',ier) |
129 |
|
|
#endif |
130 |
|
|
CALL control |
131 |
|
|
STOP 'NORMAL END: GCMPACK PE-MODEL.' |
132 |
|
|
END |