1 |
C $Header: |
2 |
|
3 |
#include "SEAICE_OPTIONS.h" |
4 |
|
5 |
CStartOfInterface |
6 |
SUBROUTINE seaice_model( myTime, myIter, myThid ) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE SEAICE_MODEL | |
9 |
C | o Time stepping of sea ice model. | |
10 |
C |==========================================================| |
11 |
C \==========================================================/ |
12 |
IMPLICIT NONE |
13 |
|
14 |
C === Global variables === |
15 |
#include "SIZE.h" |
16 |
#include "EEPARAMS.h" |
17 |
#include "DYNVARS.h" |
18 |
#include "PARAMS.h" |
19 |
#include "FFIELDS.h" |
20 |
#include "SEAICE.h" |
21 |
#include "SEAICE_PARAMS.h" |
22 |
#include "SEAICE_EXTERNAL.h" |
23 |
|
24 |
#ifdef ALLOW_AUTODIFF_TAMC |
25 |
# include "tamc.h" |
26 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
27 |
|
28 |
C === Routine arguments === |
29 |
C myTime - Simulation time |
30 |
C myIter - Simulation timestep number |
31 |
C myThid - Thread no. that called this routine. |
32 |
_RL myTime |
33 |
INTEGER myIter |
34 |
INTEGER myThid |
35 |
CEndOfInterface |
36 |
|
37 |
#ifdef ALLOW_SEAICE |
38 |
|
39 |
C === Local variables === |
40 |
C i,j,k,bi,bj - Loop counters |
41 |
|
42 |
INTEGER i, j, k, bi, bj |
43 |
|
44 |
C--- Read wind, thermal, and evaporation minus precipitation if needed |
45 |
CALL SEAICE_GET_FORCING ( myTime, myIter, myThid ) |
46 |
|
47 |
C-- Third level model velocity is used as proxy for geostrophic velocity |
48 |
DO bj=myByLo(myThid),myByHi(myThid) |
49 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
50 |
DO j=0,sNy+1 |
51 |
DO i=0,sNx+1 |
52 |
GWATX(I,J,bi,bj)=HALF*(uVel(i+1,j,3,bi,bj) |
53 |
& +uVel(i+1,j+1,3,bi,bj)) |
54 |
GWATY(I,J,bi,bj)=HALF*(vVel(i,j+1,3,bi,bj) |
55 |
& +vVel(i+1,j+1,3,bi,bj)) |
56 |
#ifdef SEAICE_DEBUG |
57 |
c write(*,'(2i4,2i2,f7.1,7f12.3)') |
58 |
c & ,i,j,bi,bj,UVM(I,J,bi,bj) |
59 |
c & ,GWATX(I,J,bi,bj),GWATY(I,J,bi,bj) |
60 |
c & ,uVel(i+1,j,3,bi,bj),uVel(i+1,j+1,3,bi,bj) |
61 |
c & ,vVel(i,j+1,3,bi,bj),vVel(i+1,j+1,3,bi,bj) |
62 |
#endif SEAICE_DEBUG |
63 |
ENDDO |
64 |
ENDDO |
65 |
ENDDO |
66 |
ENDDO |
67 |
|
68 |
C solve ice momentum equations and calculate ocean surface stress |
69 |
CALL DYNSOLVER ( myTime, myIter, myThid ) |
70 |
|
71 |
C NOW DO ADVECTION |
72 |
CALL ADVECT( UICE, VICE, HEFF, HEFFM, myThid ) |
73 |
CALL ADVECT( UICE, VICE, AREA, HEFFM, myThid ) |
74 |
|
75 |
C NOW DO GROWTH |
76 |
C MUST CALL GROWTH ONLY AFTER CALLING ADVECTION |
77 |
CALL GROWTH( myTime, myIter, myThid) |
78 |
|
79 |
C-- Update overlap regions for a bunch of stuff |
80 |
_BARRIER |
81 |
CALL EXCH_RL( HEFF, OLx, OLx, OLy, OLy, 3, OLx, OLy, |
82 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
83 |
CALL EXCH_RL( AREA, OLx, OLx, OLy, OLy, 3, OLx, OLy, |
84 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
85 |
_EXCH_XY_R4(fu , myThid ) |
86 |
_EXCH_XY_R4(fv , myThid ) |
87 |
_EXCH_XY_R4(EmPmR, myThid ) |
88 |
_EXCH_XY_R4(Qnet , myThid ) |
89 |
_EXCH_XY_R4(surfaceTendencyTice, myThid ) |
90 |
#ifdef SHORTWAVE_HEATING |
91 |
_EXCH_XY_R4(Qsw , myThid ) |
92 |
#endif SHORTWAVE_HEATING |
93 |
_EXCH_XYZ_R8(theta , myThid ) |
94 |
|
95 |
C-- Sea ice diagnostics. |
96 |
CALL SEAICE_DO_DIAGS( myTime, myIter, myThid ) |
97 |
|
98 |
C-- Write sea ice restart files |
99 |
CALL SEAICE_WRITE_PICKUP ( .FALSE., |
100 |
& myTime+deltaTClock, myIter+1, myThid ) |
101 |
|
102 |
C--------------------------------------------------- |
103 |
C OOH NOOOO we need to move the whole stuff |
104 |
C--------------------------------------------------- |
105 |
#ifdef ALLOW_AUTODIFF_TAMC |
106 |
CRG CADJ store UICE,VICE,AREA,HEFF,fu,fv,EmPmR,Qnet,Qsw = comlev1_bibj |
107 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
108 |
|
109 |
C-- Call sea-ice cost function routine |
110 |
CRG CALL SEAICE_COST( myTime, myIter, myThid ) |
111 |
|
112 |
#endif ALLOW_SEAICE |
113 |
|
114 |
RETURN |
115 |
END |