/[MITgcm]/MITgcm_contrib/gael/pkg/smooth/smooth_ensemble2D.F
ViewVC logotype

Contents of /MITgcm_contrib/gael/pkg/smooth/smooth_ensemble2D.F

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


Revision 1.2 - (show annotations) (download)
Fri Oct 16 03:36:34 2009 UTC (15 years, 9 months ago) by gforget
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
bring pkg/smooth up to date

1 #include "CPP_OPTIONS.h"
2
3 subroutine smooth_ensemble2D (mythid)
4
5
6 IMPLICIT NONE
7 #include "SIZE.h"
8 #include "EEPARAMS.h"
9 #include "GRID.h"
10 #include "PARAMS.h"
11 c#include "tamc.h"
12 #include "smooth.h"
13
14
15 _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
16 _RL fld_mean(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
17 _RL fld_meansq(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
18 _RL fld_norm(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
19 character*( 80) fnamegeneric
20 integer i,j,k,bi,bj
21 integer itlo,ithi
22 integer jtlo,jthi
23 integer myThid
24 _RL port_rand, port_rand_norm
25 integer iii,ii,nbRand
26
27 jtlo = mybylo(mythid)
28 jthi = mybyhi(mythid)
29 itlo = mybxlo(mythid)
30 ithi = mybxhi(mythid)
31
32
33
34 C initialize the random number generator:
35 fld_in(1,1,1,1)=port_rand(1)
36 nbRand=5000
37
38 C main loop:
39 DO ii=1,nbRand
40 WRITE(standardMessageUnit,'(A,I4)')
41 & 'smooth_ensemble2D ii: ',ii
42
43 C define a perturbation:
44 DO bj=jtlo,jthi
45 DO bi=itlo,ithi
46 DO j=1-OLy,sNy+OLy
47 DO i=1-OLx,sNx+OLx
48 fld_in(i,j,bi,bj)=0.
49 if (maskC(i,j,1,bi,bj).NE.0) then
50 fld_in(i,j,bi,bj)=port_rand_norm()
51 endif
52 ENDDO
53 ENDDO
54 ENDDO
55 ENDDO
56 _EXCH_XY_RL ( fld_in, myThid )
57
58 C the smoothing itself:
59 call smooth_correl2D(fld_in,maskC,1,mythid)
60
61 write(fnamegeneric(1:80),'(1a,i3.3)')
62 & 'wc01_2Densemble.',ii
63 call mdswritefield(fnamegeneric,32,.false.,'RL',
64 & 1,fld_in,1,1,mythid)
65
66 ENDDO
67
68 end

  ViewVC Help
Powered by ViewVC 1.1.22