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