1 |
jmc |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/atm_compon_interf/atm_store_aim_fields.F,v 1.1 2013/09/11 20:17:27 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_OPTIONS.h" |
6 |
|
|
#ifdef ALLOW_AIM |
7 |
|
|
# include "AIM_OPTIONS.h" |
8 |
|
|
#endif |
9 |
|
|
|
10 |
|
|
CBOP |
11 |
|
|
C !ROUTINE: ATM_STORE_AIM_FIELDS |
12 |
|
|
C !INTERFACE: |
13 |
|
|
SUBROUTINE ATM_STORE_AIM_FIELDS( |
14 |
|
|
I bi, bj, |
15 |
|
|
I myTime, myIter, myThid ) |
16 |
|
|
|
17 |
|
|
C !DESCRIPTION: \bv |
18 |
|
|
C *==========================================================* |
19 |
|
|
C | SUBROUTINE ATM_STORE_AIM_FIELDS |
20 |
|
|
C | o Routine for saving AIM fields (e.g., surface wind |
21 |
|
|
C | speed) for export to coupling layer. |
22 |
|
|
C *==========================================================* |
23 |
|
|
C | This version interfaces to the AIM package. |
24 |
|
|
C *==========================================================* |
25 |
|
|
C \ev |
26 |
|
|
|
27 |
|
|
C !USES: |
28 |
|
|
IMPLICIT NONE |
29 |
|
|
|
30 |
|
|
C == Global variables == |
31 |
|
|
#ifdef ALLOW_AIM |
32 |
|
|
# include "AIM_SIZE.h" |
33 |
|
|
#else |
34 |
|
|
# include "SIZE.h" |
35 |
|
|
#endif |
36 |
|
|
|
37 |
|
|
#include "EEPARAMS.h" |
38 |
|
|
#include "PARAMS.h" |
39 |
jmc |
1.2 |
c#include "ATMIDS.h" |
40 |
jmc |
1.1 |
#include "CPL_PARAMS.h" |
41 |
|
|
#ifdef ALLOW_AIM |
42 |
|
|
# include "AIM2DYN.h" |
43 |
|
|
# include "AIM_CO2.h" |
44 |
|
|
#endif |
45 |
|
|
C == Global variables for coupling interface == |
46 |
|
|
#include "ATMCPL.h" |
47 |
|
|
|
48 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
49 |
|
|
C bi, bj :: Tile indices |
50 |
|
|
C myTime :: Current time in simulation (s) |
51 |
|
|
C myIter :: Current iteration number |
52 |
|
|
C myThid :: My Thread Id. number |
53 |
|
|
INTEGER bi, bj |
54 |
|
|
_RL myTime |
55 |
|
|
INTEGER myIter |
56 |
|
|
INTEGER myThid |
57 |
|
|
CEOP |
58 |
|
|
|
59 |
|
|
#ifdef ALLOW_AIM |
60 |
|
|
C !LOCAL VARIABLES: |
61 |
|
|
C i, j :: Loop counters |
62 |
|
|
INTEGER i,j |
63 |
|
|
_RL cplTimeFraction |
64 |
|
|
|
65 |
|
|
cplTimeFraction = 1. _d 0 / DFLOAT(cplSendFrq_iter) |
66 |
|
|
|
67 |
|
|
C o Accumulate atmospheric surface wind speed (m/s) from AIM pkg |
68 |
|
|
C that will be exported to the coupling layer. |
69 |
|
|
sWSpeedTime(bi,bj) = sWSpeedTime(bi,bj) + cplTimeFraction |
70 |
|
|
DO j=1,sNy |
71 |
|
|
DO i=1,sNx |
72 |
|
|
sWSpeed(i,j,bi,bj) = sWSpeed(i,j,bi,bj) |
73 |
|
|
& + aim_surfWind(i,j,bi,bj)*cplTimeFraction |
74 |
|
|
ENDDO |
75 |
|
|
ENDDO |
76 |
|
|
|
77 |
|
|
#ifdef ALLOW_AIM_CO2 |
78 |
jmc |
1.2 |
c IF ( atmCpl_exchange_DIC ) THEN |
79 |
jmc |
1.1 |
C o Accumulate atmospheric CO2 from Aim pkg that will be exported |
80 |
|
|
C to the coupling layer. |
81 |
|
|
airCO2Time(bi,bj) = airCO2Time(bi,bj) + cplTimeFraction |
82 |
|
|
DO j=1,sNy |
83 |
|
|
DO i=1,sNx |
84 |
|
|
airCO2(i,j,bi,bj) = airCO2(i,j,bi,bj) |
85 |
|
|
& + aim_CO2(i,j,bi,bj)*cplTimeFraction |
86 |
|
|
ENDDO |
87 |
|
|
ENDDO |
88 |
jmc |
1.2 |
c ENDIF |
89 |
jmc |
1.1 |
#endif /* ALLOW_AIM_CO2 */ |
90 |
|
|
|
91 |
|
|
#endif /* ALLOW_AIM */ |
92 |
|
|
|
93 |
|
|
RETURN |
94 |
|
|
END |