#include "CPP_OPTIONS.h" subroutine smooth_correl2D ( U fld_in,mask_in,smoothOpNb,mythid) IMPLICIT NONE #include "SIZE.h" #include "EEPARAMS.h" #include "GRID.h" #include "PARAMS.h" c#include "tamc.h" #include "smooth.h" _RL mask_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) integer smoothOpNb integer nbt_in character*( 80) fnamegeneric integer i,j,bi,bj integer itlo,ithi integer jtlo,jthi integer myThid jtlo = mybylo(mythid) jthi = mybyhi(mythid) itlo = mybxlo(mythid) ithi = mybxhi(mythid) smoothOpNbCur=smoothOpNb nbt_in=wc01_2D_nbt(smoothOpNbCur)/2 cgf later: have an index for the operator number cfg and do not forget common block parts (nbt...) c write(fnamegeneric(1:80),'(1a)') C & 'wc01_2Doperator' write(fnamegeneric(1:80),'(1a,i3.3)') & 'wc01_2Doperator',smoothOpNbCur call mdsreadfield(fnamegeneric,64,'RL',1, & diffKhwc01_2D_x,1,mythid) call mdsreadfield(fnamegeneric,64,'RL',1, & diffKhwc01_2D_y,2,mythid) _EXCH_XY_RL ( diffKhwc01_2D_x, myThid ) _EXCH_XY_RL ( diffKhwc01_2D_y, myThid ) c write(fnamegeneric(1:80),'(1a)') c & 'wc01_2D_filternorm' write(fnamegeneric(1:80),'(1a,i3.3)') & 'wc01_2Dfilternorm',smoothOpNbCur call mdsreadfield(fnamegeneric,64,'RL',1, & normFilterwc01_2D,1,mythid) _EXCH_XY_RL ( normFilterwc01_2D, myThid ) DO bj = jtlo,jthi DO bi = itlo,ithi DO j = 1,sNy DO i = 1,sNx c division by ~sqrt(volume): fld_in(i,j,bi,bj)=fld_in(i,j,bi,bj) & *sqrt(recip_rA(i,j,bi,bj)) ENDDO ENDDO ENDDO ENDDO call smooth_diff2D(fld_in,mask_in,nbt_in,mythid) do bj = jtlo,jthi do bi = itlo,ithi DO j = 1,sNy DO i = 1,sNx c division by ~sqrt(var(filter)): fld_in(i,j,bi,bj)=fld_in(i,j,bi,bj) & *normFilterwc01_2D(i,j,bi,bj) ENDDO ENDDO ENDDO ENDDO _EXCH_XY_RL ( fld_in , myThid ) end