/[MITgcm]/MITgcm/pkg/atm_compon_interf/atm_export_fld.F
ViewVC logotype

Contents of /MITgcm/pkg/atm_compon_interf/atm_export_fld.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Fri Dec 25 19:44:35 2009 UTC (14 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint65p, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.1: +14 -3 lines
fix for multi-threaded

1 C $Header: /u/gcmpack/MITgcm/pkg/aim_compon_interf/atm_export_fld.F,v 1.1 2006/07/02 22:47:19 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: ATM_EXPORT_FLD
8 C !INTERFACE:
9 SUBROUTINE ATM_EXPORT_FLD(
10 I atmFldName,
11 U atmFld, countTime,
12 I myThid )
13
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | SUBROUTINE ATM_EXPORT_FLD
17 C | o Routine for exporting 1 atmos. field to coupling layer:
18 C | - compute the time-average (if needed)
19 C | - send the field to the coupler
20 C | - reset time and field to zero
21 C *==========================================================*
22 C | This version talks to the MIT Coupler. It uses the MIT
23 C | Coupler "checkpoint1" library calls.
24 C | Note: requires arg. array "atmFld" to be shared
25 C | (in common block) to work in multi-threaded.
26 C *==========================================================*
27 C \ev
28
29 C !USES:
30 IMPLICIT NONE
31 C == Global variables ==
32 #include "SIZE.h"
33 #include "EEPARAMS.h"
34
35 C !INPUT/OUTPUT PARAMETERS:
36 C === Routine arguments ===
37 C atmFldName :: atmos. Field identificator name
38 C atmFld :: array containing the atmospheric Field to export
39 C countTime :: fractional integrated time
40 C myThid :: my Thread Id number
41 CHARACTER*(*) atmFldName
42 _RL atmFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
43 _RL countTime(nSx,nSy)
44 INTEGER myThid
45 CEOP
46
47 #ifdef COMPONENT_MODULE
48 C !LOCAL VARIABLES:
49 C == Local variables ==
50 C recipAvT :: Temp. for holding reciprocal of averaging period.
51 C i,j,bi,bj :: Loop counters
52 _RL recipAvT
53 INTEGER i,j,bi,bj
54
55 C Convert time integrated heatflux to mean value ready for export.
56 DO bj=myByLo(myThid),myByHi(myThid)
57 DO bi=myBxLo(myThid),myBxHi(myThid)
58 IF ( ABS(countTime(bi,bj) -1. _d 0).GT. 1. _d -12
59 & .AND. countTime(bi,bj) .NE. 0. ) THEN
60 recipAvT = 1. _d 0/countTime(bi,bj)
61 DO j=1,sNy
62 DO i=1,sNx
63 atmFld(i,j,bi,bj) = atmFld(i,j,bi,bj)*recipAvT
64 ENDDO
65 ENDDO
66 WRITE(errorMessageUnit,'(3A,2I4,1PE15.8)')
67 & 'ATM_EXPORT_FLD: ',atmFldName,' : 1-CountTime=',
68 & bi,bj,1.-countTime(bi,bj)
69 ENDIF
70 ENDDO
71 ENDDO
72
73 C Send atmos. field to coupling layer.
74 _BARRIER
75 _BEGIN_MASTER( myThid )
76 CALL COMPSEND_R8TILES(
77 I atmFldName, sNx, OLx, sNy, OLy, 1, nSx, nSy,
78 I atmFld )
79 _END_MASTER( myThid )
80 _BARRIER
81
82 C Reset atmos. field & integrated time before accumulating again.
83 DO bj=myByLo(myThid),myByHi(myThid)
84 DO bi=myBxLo(myThid),myBxHi(myThid)
85 countTime(bi,bj) = 0.
86 DO j=1,sNy
87 DO i=1,sNx
88 atmFld(i,j,bi,bj) = 0.
89 ENDDO
90 ENDDO
91 ENDDO
92 ENDDO
93
94 #endif /* COMPONENT_MODULE */
95
96 RETURN
97 END

  ViewVC Help
Powered by ViewVC 1.1.22