File indexing completed on 2018-03-02 18:40:03 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
a456aa407c Andr*0001 #include "FIZHI_OPTIONS.h"
28c2441183 Jean*0002 subroutine AtoC(myThid,fieldin1,fieldin2,mask,idim1,idim2,
0003 . jdim1,jdim2,numlevs,Nsx,Nsy,im1,im2,jm1,jm2,fieldout1,fieldout2)
e337e4ca8c Andr*0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
28c2441183 Jean*0015
e337e4ca8c Andr*0016
0017
28c2441183 Jean*0018
e337e4ca8c Andr*0019
0020
0021
0022
c40f81fe30 Jean*0023
e337e4ca8c Andr*0024
0025 implicit none
0026 #include "EEPARAMS.h"
c40f81fe30 Jean*0027
e337e4ca8c Andr*0028 integer myThid, numlevs
0029 integer Nsx, Nsy
28c2441183 Jean*0030 integer idim1, idim2, jdim1, jdim2, im1, im2, jm1, jm2
0031 _RS mask(idim1:idim2,jdim1:jdim2,numlevs,Nsx,Nsy)
0032 _RL fieldin1(idim1:idim2,jdim1:jdim2,numlevs,Nsx,Nsy)
0033 _RL fieldin2(idim1:idim2,jdim1:jdim2,numlevs,Nsx,Nsy)
0034 _RL fieldout1(idim1:idim2,jdim1:jdim2,numlevs,Nsx,Nsy)
0035 _RL fieldout2(idim1:idim2,jdim1:jdim2,numlevs,Nsx,Nsy)
e337e4ca8c Andr*0036
0037 integer i, j, L, bi, bj
28c2441183 Jean*0038 _RL tmpfld1(idim1:idim2,jdim1:jdim2)
0039 _RL tmpfld2(idim1:idim2,jdim1:jdim2)
e337e4ca8c Andr*0040
0041
c40f81fe30 Jean*0042 CALL EXCH_UV_AGRID_3D_RL(
0043 U fieldin1, fieldin2,
0044 I .TRUE., numlevs, myThid )
e337e4ca8c Andr*0045
0046
0047 do bj = myByLo(myThid), myByHi(myThid)
0048 do bi = myBxLo(myThid), myBxHi(myThid)
0049
0050 do L = 1,numlevs
f98d2ec0f4 Andr*0051 do j = jdim1,jdim2
28c2441183 Jean*0052 do i = idim1,idim2
0053 tmpfld1(i,j) = fieldin1(i,j,L,bi,bj)*mask(i,j,L,bi,bj)
0054 tmpfld2(i,j) = fieldin2(i,j,L,bi,bj)*mask(i,j,L,bi,bj)
0055 enddo
0056 enddo
0057 do j = jm1,jm2
0058 do i = im1,im2
0059
0060
e337e4ca8c Andr*0061 if( (mask(i-1,j,L,bi,bj).ne.0.) .or.
0062 . (mask(i,j,L,bi,bj).ne.0.) ) then
28c2441183 Jean*0063
0064
0065
0066
e337e4ca8c Andr*0067 fieldout1(i,j,L,bi,bj) =
28c2441183 Jean*0068 . ( tmpfld1(i-1,j) + tmpfld1(i,j) ) /
e337e4ca8c Andr*0069 . ( mask(i-1,j,L,bi,bj) + mask(i,j,L,bi,bj) )
0070 else
0071 fieldout1(i,j,L,bi,bj) = 0.
0072 endif
0073 if( (mask(i,j-1,L,bi,bj).ne.0.) .or.
0074 . (mask(i,j,L,bi,bj).ne.0.) ) then
28c2441183 Jean*0075
0076
0077
0078
e337e4ca8c Andr*0079 fieldout2(i,j,L,bi,bj) =
28c2441183 Jean*0080 . ( tmpfld2(i,j-1) + tmpfld2(i,j) ) /
e337e4ca8c Andr*0081 . ( mask(i,j,L,bi,bj) + mask(i,j-1,L,bi,bj) )
0082 else
0083 fieldout2(i,j,L,bi,bj) = 0.
0084 endif
0085 enddo
0086 enddo
0087 enddo
0088
0089 enddo
0090 enddo
0091
0092 return
0093 end