1 |
mlosch |
1.30 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_model.F,v 1.29 2006/03/03 07:52:01 mlosch Exp $ |
2 |
edhill |
1.9 |
C $Name: $ |
3 |
heimbach |
1.2 |
|
4 |
|
|
#include "SEAICE_OPTIONS.h" |
5 |
|
|
|
6 |
dimitri |
1.23 |
CBOP |
7 |
|
|
C !ROUTINE: SEAICE_MODEL |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
heimbach |
1.2 |
SUBROUTINE seaice_model( myTime, myIter, myThid ) |
11 |
dimitri |
1.23 |
|
12 |
|
|
C !DESCRIPTION: \bv |
13 |
dimitri |
1.7 |
C /===========================================================\ |
14 |
|
|
C | SUBROUTINE SEAICE_MODEL | |
15 |
|
|
C | o Time stepping of a dynamic/thermodynamic sea ice model. | |
16 |
|
|
C | Dynamics solver: Zhang/Hibler, JGR, 102, 8691-8702, 1997 | |
17 |
|
|
C | Thermodynamics: Hibler, MWR, 108, 1943-1973, 1980 | |
18 |
|
|
C | Rheology: Hibler, JPO, 9, 815- 846, 1979 | |
19 |
|
|
C | Snow: Zhang et al. , JPO, 28, 191- 217, 1998 | |
20 |
|
|
C | Parallel forward ice model written by Jinlun Zhang PSC/UW| |
21 |
|
|
C | & coupled into MITgcm by Dimitris Menemenlis (JPL) 2/2001| |
22 |
|
|
C | zhang@apl.washington.edu / menemenlis@jpl.nasa.gov | |
23 |
|
|
C |===========================================================| |
24 |
|
|
C \===========================================================/ |
25 |
heimbach |
1.2 |
IMPLICIT NONE |
26 |
dimitri |
1.23 |
c \ev |
27 |
heimbach |
1.2 |
|
28 |
dimitri |
1.23 |
C !USES: =============================================================== |
29 |
heimbach |
1.2 |
C === Global variables === |
30 |
|
|
#include "SIZE.h" |
31 |
|
|
#include "EEPARAMS.h" |
32 |
|
|
#include "DYNVARS.h" |
33 |
|
|
#include "PARAMS.h" |
34 |
dimitri |
1.17 |
#include "GRID.h" |
35 |
heimbach |
1.2 |
#include "FFIELDS.h" |
36 |
|
|
#include "SEAICE.h" |
37 |
|
|
#include "SEAICE_PARAMS.h" |
38 |
|
|
|
39 |
heimbach |
1.8 |
#ifdef SEAICE_EXTERNAL_FORCING |
40 |
|
|
# include "SEAICE_FFIELDS.h" |
41 |
|
|
#endif |
42 |
|
|
|
43 |
dimitri |
1.3 |
#ifdef ALLOW_AUTODIFF_TAMC |
44 |
|
|
# include "tamc.h" |
45 |
dimitri |
1.5 |
#endif |
46 |
dimitri |
1.4 |
|
47 |
dimitri |
1.23 |
C !INPUT PARAMETERS: =================================================== |
48 |
heimbach |
1.2 |
C === Routine arguments === |
49 |
|
|
C myTime - Simulation time |
50 |
|
|
C myIter - Simulation timestep number |
51 |
|
|
C myThid - Thread no. that called this routine. |
52 |
|
|
_RL myTime |
53 |
|
|
INTEGER myIter |
54 |
|
|
INTEGER myThid |
55 |
|
|
CEndOfInterface |
56 |
|
|
|
57 |
dimitri |
1.23 |
C !LOCAL VARIABLES: ==================================================== |
58 |
heimbach |
1.2 |
C === Local variables === |
59 |
dimitri |
1.4 |
C i,j,bi,bj - Loop counters |
60 |
dimitri |
1.20 |
INTEGER i, j, bi, bj |
61 |
jmc |
1.27 |
LOGICAL DIFFERENT_MULTIPLE |
62 |
|
|
EXTERNAL DIFFERENT_MULTIPLE |
63 |
dimitri |
1.23 |
CEOP |
64 |
heimbach |
1.2 |
|
65 |
dimitri |
1.4 |
#ifdef SEAICE_EXTERNAL_FORCING |
66 |
|
|
C-- Atmospheric state and runoff are from |
67 |
|
|
C pkg/exf, which does not update edges. |
68 |
dimitri |
1.14 |
CALL EXCH_UV_XY_RL(uwind,vwind,.TRUE.,myThid) |
69 |
|
|
_EXCH_XY_R8( atemp, myThid ) |
70 |
|
|
_EXCH_XY_R8( aqh, myThid ) |
71 |
|
|
_EXCH_XY_R8( lwdown, myThid ) |
72 |
|
|
_EXCH_XY_R8( swdown, mythid ) |
73 |
|
|
_EXCH_XY_R8( precip, myThid ) |
74 |
|
|
_EXCH_XY_R8( evap, myThid ) |
75 |
|
|
_EXCH_XY_R8( runoff, myThid ) |
76 |
dimitri |
1.5 |
#else /* SEAICE_EXTERNAL_FORCING */ |
77 |
dimitri |
1.4 |
C-- Load atmospheric state and runoff. |
78 |
heimbach |
1.2 |
CALL SEAICE_GET_FORCING ( myTime, myIter, myThid ) |
79 |
dimitri |
1.5 |
#endif /* SEAICE_EXTERNAL_FORCING */ |
80 |
heimbach |
1.2 |
|
81 |
heimbach |
1.8 |
#ifdef ALLOW_AUTODIFF_TAMC |
82 |
|
|
CADJ STORE uwind = comlev1, key = ikey_dynamics |
83 |
|
|
CADJ STORE vwind = comlev1, key = ikey_dynamics |
84 |
heimbach |
1.12 |
CADJ STORE heff = comlev1, key = ikey_dynamics |
85 |
heimbach |
1.8 |
# ifdef SEAICE_ALLOW_DYNAMICS |
86 |
|
|
CADJ STORE area = comlev1, key = ikey_dynamics |
87 |
|
|
# endif |
88 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
89 |
|
|
|
90 |
heimbach |
1.2 |
C solve ice momentum equations and calculate ocean surface stress |
91 |
jmc |
1.27 |
IF ( |
92 |
|
|
& DIFFERENT_MULTIPLE(SEAICE_deltaTdyn,myTime,SEAICE_deltaTtherm) |
93 |
|
|
& ) THEN |
94 |
mlosch |
1.30 |
#ifdef SEAICE_CGRID |
95 |
|
|
CALL TIMER_START('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) |
96 |
|
|
CALL SEAICE_DYNSOLVER ( myTime, myIter, myThid ) |
97 |
|
|
CALL TIMER_STOP ('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) |
98 |
|
|
#else |
99 |
dimitri |
1.21 |
CALL TIMER_START('DYNSOLVER [SEAICE_MODEL]',myThid) |
100 |
|
|
CALL DYNSOLVER ( myTime, myIter, myThid ) |
101 |
|
|
CALL TIMER_STOP ('DYNSOLVER [SEAICE_MODEL]',myThid) |
102 |
mlosch |
1.30 |
#endif /* SEAICE_CGRID */ |
103 |
dimitri |
1.21 |
ENDIF |
104 |
heimbach |
1.2 |
|
105 |
heimbach |
1.8 |
#ifdef ALLOW_AUTODIFF_TAMC |
106 |
|
|
# ifdef SEAICE_ALLOW_DYNAMICS |
107 |
|
|
CADJ STORE heff = comlev1, key = ikey_dynamics |
108 |
|
|
CADJ STORE area = comlev1, key = ikey_dynamics |
109 |
|
|
CADJ STORE uice = comlev1, key = ikey_dynamics |
110 |
|
|
CADJ STORE vice = comlev1, key = ikey_dynamics |
111 |
|
|
# endif |
112 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
113 |
mlosch |
1.28 |
C NOW DO ADVECTION and DIFFUSION |
114 |
|
|
CALL SEAICE_ADVDIFF( myTime, myIter, myThid ) |
115 |
heimbach |
1.2 |
|
116 |
|
|
C NOW DO GROWTH |
117 |
|
|
C MUST CALL GROWTH ONLY AFTER CALLING ADVECTION |
118 |
mlosch |
1.28 |
CALL GROWTH( myTime, myIter, myThid ) |
119 |
heimbach |
1.2 |
|
120 |
|
|
C-- Update overlap regions for a bunch of stuff |
121 |
dimitri |
1.14 |
_BARRIER |
122 |
|
|
CALL SEAICE_EXCH( HEFF, myThid ) |
123 |
|
|
CALL SEAICE_EXCH( AREA, myThid ) |
124 |
|
|
CALL EXCH_UV_XY_RS(fu,fv,.TRUE.,myThid) |
125 |
|
|
_EXCH_XY_R4(EmPmR, myThid ) |
126 |
|
|
_EXCH_XY_R4(Qnet , myThid ) |
127 |
heimbach |
1.2 |
#ifdef SHORTWAVE_HEATING |
128 |
dimitri |
1.14 |
_EXCH_XY_R4(Qsw , myThid ) |
129 |
dimitri |
1.5 |
#endif |
130 |
dimitri |
1.14 |
_EXCH_XYZ_R8(theta , myThid ) |
131 |
heimbach |
1.2 |
|
132 |
|
|
C-- Sea ice diagnostics. |
133 |
dimitri |
1.16 |
C <= moved to S/R do_the_model_io with other pkgs |
134 |
heimbach |
1.2 |
|
135 |
|
|
C-- Write sea ice restart files |
136 |
jmc |
1.15 |
C <= moved to S/R packages_write_pickup with other pkgs |
137 |
dimitri |
1.3 |
|
138 |
|
|
C--------------------------------------------------- |
139 |
|
|
C OOH NOOOO we need to move the whole stuff |
140 |
|
|
C--------------------------------------------------- |
141 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
142 |
|
|
CRG CADJ store UICE,VICE,AREA,HEFF,fu,fv,EmPmR,Qnet,Qsw = comlev1_bibj |
143 |
dimitri |
1.5 |
#endif |
144 |
dimitri |
1.3 |
|
145 |
|
|
C-- Call sea-ice cost function routine |
146 |
|
|
CRG CALL SEAICE_COST( myTime, myIter, myThid ) |
147 |
heimbach |
1.2 |
|
148 |
|
|
RETURN |
149 |
|
|
END |