Oasis3 4.0.2
|
00001 SUBROUTINE glored (pzgg, pworkgr, klon, klat, ktronca) 00002 C***** 00003 C ***************************** 00004 C * OASIS ROUTINE - LEVEL 3 * 00005 C * ------------- ------- * 00006 C ***************************** 00007 C 00008 C**** *glored* - Global gaussian grid transformation 00009 C 00010 C Purpose: 00011 C ------- 00012 C Linear interpolation of field from full gaussian grid to reduced grid 00013 C 00014 C N.B: It is assumed that a preprocessing of the field on the full grid 00015 C was done to allocate ocean values to land points as no mask is used 00016 C in this routine. 00017 C 00018 C** Interface: 00019 C --------- 00020 C *CALL* *glored (pzgg, pworkgr, klon, klat, ktronca)* 00021 C 00022 C Input: 00023 C ----- 00024 C pzgg : field on global grid (real 2D) 00025 C pworkgr : array to store field on global grid (real 2D) 00026 C klon : number of longitudes of global grid 00027 C klat : number of latitudes of both grids 00028 C ktronca : truncature of gaussian grid 00029 C 00030 C Output: 00031 C ------ 00032 C pzgg: field on reduced grid (real 2D) 00033 C 00034 C Workspace: 00035 C --------- 00036 C inip 00037 C 00038 C Externals: 00039 C --------- 00040 C None 00041 C 00042 C Reference: 00043 C --------- 00044 C See OASIS manual (1995) 00045 C 00046 C History: 00047 C ------- 00048 C Version Programmer Date Description 00049 C ------- ---------- ---- ----------- 00050 C 1.0 L. Terray 94/01/01 created 00051 C 2.0 L. Terray 95/09/01 modified 00052 C 2.3 L. terray 99/03/01 bug corrected: inip DIMENSION 00053 C 2.3 S. Valcke 99/03/16 modified for T213 and T319 00054 C 2.3 S. Valcke 99/03/26 changed troncature for number of 00055 C latitude between equator and pole 00056 C 2.3 S. Valcke 99/04/30 added: printing levels 00057 C 00058 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00059 C 00060 C* ---------------------------- Include files --------------------------- 00061 C 00062 USE mod_unit 00063 USE mod_gauss 00064 USE mod_printing 00065 C 00066 C* ---------------------------- Argument declarations ------------------- 00067 C 00068 00069 REAL (kind=ip_realwp_p) pzgg(klon,klat), pworkgr(klon*klat) 00070 INTEGER (kind=ip_intwp_p) inip(320) 00071 C 00072 C* ---------------------------- Poema verses ---------------------------- 00073 C 00074 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00075 C 00076 C* 1. Initialization 00077 C -------------- 00078 C 00079 IF (nlogprt .GE. 2) THEN 00080 WRITE (UNIT = nulou,FMT = *) ' ' 00081 WRITE (UNIT = nulou,FMT = *) 00082 $ ' ROUTINE glored - Level 3' 00083 WRITE (UNIT = nulou,FMT = *) 00084 $ ' ************** *******' 00085 WRITE (UNIT = nulou,FMT = *) ' ' 00086 WRITE (UNIT = nulou,FMT = *) ' Go from global to reduced grid' 00087 WRITE (UNIT = nulou,FMT = *) ' ' 00088 CALL FLUSH(nulou) 00089 ENDIF 00090 CALL izero(inip,320) 00091 C 00092 C 00093 C* 2. Full to reduced linear interpolation 00094 C ------------------------------------ 00095 C 00096 C 00097 C* get number of longitudes by latitude circle 00098 C 00099 IF (ktronca .EQ. 16) THEN 00100 DO 210 ji = 1, ktronca 00101 inip(ji) = ninip16(ji) 00102 210 CONTINUE 00103 ELSE IF (ktronca .EQ. 24) THEN 00104 DO 220 ji = 1, ktronca 00105 inip(ji) = ninip24(ji) 00106 220 CONTINUE 00107 ELSE IF (ktronca .EQ. 32) THEN 00108 DO 230 ji = 1, ktronca 00109 inip(ji) = ninip32(ji) 00110 230 CONTINUE 00111 ELSE IF (ktronca .EQ. 48) THEN 00112 DO 240 ji = 1, ktronca 00113 inip(ji) = ninip48(ji) 00114 240 CONTINUE 00115 ELSE IF (ktronca .EQ. 80) THEN 00116 DO 250 ji = 1, ktronca 00117 inip(ji) = ninip80(ji) 00118 250 CONTINUE 00119 ELSE IF (ktronca .EQ. 160) THEN 00120 DO 255 ji = 1, ktronca 00121 inip(ji) = ninip160(ji) 00122 255 CONTINUE 00123 ELSE 00124 CALL prtout 00125 $ ( 00126 'WARNING!!! Oasis cannot treat this grid with 2*NO $ latitude lines with NO = ', ktronca, 2) 00127 CALL prtout('Implement data for NO =', ktronca, 2) 00128 CALL HALTE('STOP in glored') 00129 ENDIF 00130 C 00131 C* Extend inip array to both hemispheres 00132 C 00133 DO 260 ji = klat/2 + 1, klat 00134 inip(ji) = inip(klat - ji + 1) 00135 260 CONTINUE 00136 C 00137 C* Do the interpolation global to reduced 00138 C 00139 indice = 0 00140 DO 270 jk = 1, klat 00141 DO 280 ji = 1, inip(jk) 00142 zxi = 1 + ((ji - 1) * klon) / FLOAT(inip(jk)) 00143 im = INT(zxi) 00144 zdx = zxi - im 00145 im = 1 + MOD(im + klon - 1,klon) 00146 ip = 1 + MOD(im,klon) 00147 pworkgr(indice + ji) = pzgg(im,jk) * (1.-zdx) 00148 $ + pzgg(ip,jk) * zdx 00149 280 CONTINUE 00150 indice = indice + inip(jk) 00151 270 CONTINUE 00152 C 00153 C* Assign reduced grid values to array pzgg 00154 C 00155 DO 290 jj = 1, klat 00156 DO 295 ji = 1, klon 00157 pzgg(ji,jj) = pworkgr(klon*(jj-1)+ji) 00158 295 CONTINUE 00159 290 CONTINUE 00160 C 00161 C 00162 C* 3. End of routine 00163 C -------------- 00164 C 00165 IF (nlogprt .GE. 2) THEN 00166 WRITE (UNIT = nulou,FMT = *) ' ' 00167 WRITE (UNIT = nulou,FMT = *) 00168 $ ' --------- End of ROUTINE glored ---------' 00169 CALL FLUSH (nulou) 00170 ENDIF 00171 RETURN 00172 END 00173