Oasis3 4.0.2
postpro.f
Go to the documentation of this file.
00001       SUBROUTINE postpro (kindex, kfield)
00002 C****
00003 C               *****************************
00004 C               * OASIS ROUTINE  -  LEVEL 1 *
00005 C               * -------------     ------- *
00006 C               *****************************
00007 C
00008 C**** *postpro* - postprocessing routine
00009 C
00010 C
00011 C     Purpose:
00012 C     -------
00013 C     Do the field postprocessing
00014 C
00015 C**   Interface:
00016 C     ---------
00017 C       *CALL*  *postpro (kindex, kfield)*
00018 C
00019 C     Input:
00020 C     -----
00021 C                kindex : current active fields index array
00022 C                kfield : current active fields total number
00023 C
00024 C     Output:
00025 C     ------
00026 C     None
00027 C
00028 C     Workspace:
00029 C     ---------
00030 C     None
00031 C
00032 C     Externals:
00033 C     ---------
00034 C     reverse, revmsk, masq, extrap, glored, chkfld
00035 C
00036 C     Reference:
00037 C     ---------
00038 C     See OASIS manual (1995)
00039 C
00040 C     History:
00041 C     -------
00042 C       Version   Programmer     Date      Description
00043 C       -------   ----------     ----      -----------  
00044 C       2.0       L. Terray      95/09/01  created
00045 C       2.1       L. Terray      96/09/25  modified: call to chkfld and
00046 C                                          addition of amskred
00047 C       2.2       L. Terray      97/12/31  modified: call to extrap
00048 C       2.3       L. Terray      99/03/01  modified: call to extrap
00049 C       2.3       S. Valcke      99/04/15  modified: CALL to extrap
00050 C       2.3       S. Valcke      99/04/30  added: printing levels
00051 C       2.3       L. Terray      99/09/15  changed periodicity variables
00052 C       2.3       S. Valcke      99/10/14  CALL to extrap corrected
00053 C       2.5       S. Valcke      00/09/05  Changed iintflx for itoutflx 
00054 C
00055 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00056 C
00057 C* ---------------- Include files and USE of modules---------------------------
00058 C
00059       USE mod_unit
00060       USE mod_parameter
00061       USE mod_string
00062       USE mod_analysis
00063       USE mod_memory
00064       USE mod_extrapol
00065       USE mod_gauss
00066       USE mod_label
00067       USE mod_printing
00068 C
00069 C* ---------------------------- Argument declarations -------------------
00070 C
00071       INTEGER (kind=ip_intwp_p) kindex(kfield)
00072 C
00073 C* ---------------------------- Local declarations ----------------------
00074 C
00075       CHARACTER*8 clxordaf, clyordaf, clextmet, clname, clper
00076       CHARACTER*32 clabel
00077 C
00078 C* ---------------------------- Poema verses ----------------------------
00079 C
00080 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00081 C
00082 C*    1. Initialization
00083 C        --------------
00084 C
00085       IF (nlogprt .GE. 2) THEN
00086           WRITE (UNIT = nulou,FMT = *)' '
00087           WRITE (UNIT = nulou,FMT = *)'     ROUTINE postpro  -  Level 1'
00088           WRITE (UNIT = nulou,FMT = *)'     ***************     *******'
00089           WRITE (UNIT = nulou,FMT = *)' '
00090           WRITE (UNIT = nulou,FMT = *)'Postprocessing coupling fields'
00091           WRITE (UNIT = nulou,FMT = *)' '
00092           CALL FLUSH(nulou)
00093       ENDIF
00094 C
00095 C
00096 C*    2. Do the job
00097 C        ----------
00098 C
00099 !$omp parallel do default (shared)
00100 !$omp+ private (jf,ifield,iadrnew,iadrnew_grid)
00101 !$omp+ private (isiznew,clname,clyordaf)
00102 !$omp+ private (ilabel,clabel,ilonaf,ilataf,clxordaf)
00103 !$omp+ private (itoutflx,ja,ji,clextmet,clper)
00104 !$omp+ private (itronca,ineibor,iper)
00105 
00106       DO 210 jf = 1, kfield
00107 C
00108 C* Assign local variables
00109 C
00110         ifield = kindex(jf)
00111         iadrnew = nadrnew(ifield)
00112         iadrnew_grid = nadrnew_grid(ifield)
00113         isiznew = nsiznew(ifield)
00114         clname = cnamout(ifield)
00115         ilabel = numlab(ifield)
00116         clabel = cfldlab(ilabel)
00117         ilonaf = nlonaf(ifield)
00118         ilataf = nlataf(ifield)
00119         clxordaf = cxordaf(ifield)
00120         clyordaf = cyordaf(ifield)
00121         itoutflx = ntoutflx(ifield)
00122 C
00123 C* Print field name
00124 C
00125         IF (nlogprt .GE. 1) THEN
00126             CALL prcout('Treatment of field : ', clname, 2)
00127         ENDIF
00128 C
00129 C* - Do postprocessing analysis
00130 C
00131         DO 220 ja = 1, ig_ntrans(ifield)
00132 C
00133 C* --->>> MaskP
00134 C
00135           IF (canal(ja,ifield) .EQ. 'MASKP') THEN 
00136             
00137               CALL masq(fldnew(iadrnew), isiznew, amskvalnew(ifield),
00138      $                      msknew(iadrnew_grid))
00139 C
00140 C* --->>> Reverse
00141 C
00142           ELSE IF (canal(ja,ifield) .EQ. 'REVERSE') THEN 
00143               CALL reverse (fldnew(iadrnew), ilonaf,
00144      $                      ilataf, clxordaf, clyordaf)
00145 C
00146 C* --->>> Checkout: perform basic checks on the field to be exported
00147 C
00148           ELSE IF (canal(ja,ifield) .EQ. 'CHECKOUT') THEN
00149               CALL chkfld(clname, clabel, 
00150      $            fldnew(iadrnew), msknew(iadrnew_grid), 
00151      $            surnew(iadrnew_grid),
00152      $            isiznew, ilonaf, itoutflx)
00153 C
00154 C* --->>> Glored
00155 C
00156           ELSE IF (canal(ja,ifield) .EQ. 'GLORED') THEN
00157 C
00158 C* Do extrapolation on full grid to assign sea values to land points
00159 C
00160 C* - First we mask the field
00161 C    We use a predefined value for the mask
00162 C    If necessary, we reorder the mask as the field might have been already
00163 C    reversed ( while array msknew is ordered along OASIS conventions). 
00164 C
00165 C* Put mask in work array
00166 C
00167               CALL izero (nwork, ig_nwork)
00168               DO 230 ji = 1, isiznew
00169                 nwork(ji) = msknew(iadrnew_grid + ji -1)
00170  230          CONTINUE 
00171 C
00172 C* Reverse mask if necessary
00173 C
00174               CALL revmsk (nwork(1), ilonaf, ilataf,
00175      $            clxordaf, clyordaf)
00176               zmskval = amskred
00177               CALL masq (fldnew(iadrnew), isiznew, zmskval,
00178      $            nwork(1))
00179 C
00180 C* - Then we extrapolate
00181 C    We use predefined values for extrapolation parameters
00182 C
00183               clextmet = 'NINENN'
00184               ineibor = neighborg(ifield)
00185 C
00186 C* Grid periodicity
00187 C
00188               clper = ctper(ifield)
00189               iper = notper(ifield)
00190 C
00191 C* Zero work array
00192 C
00193               CALL szero (work, ig_work)
00194 C
00195 C* Do it now
00196 C
00197               CALL extrap (fldnew(iadrnew), zmskval, work(1), 
00198      $            nwork(1), ilonaf, ilataf,
00199      $            ineibor, clextmet, clper, iper,
00200      $            niwtng(ifield), nninnflg(ifield))
00201 C
00202 C* Do the interpolation full to reduced gaussian grid
00203 C
00204               itronca = ntronca(ifield)
00205               CALL szero (work, ig_work)
00206               CALL glored (fldnew(iadrnew), work(1),
00207      $                     ilonaf, ilataf, itronca)
00208           ELSE
00209               CONTINUE
00210           END IF
00211  220    CONTINUE
00212  210  CONTINUE 
00213 C
00214 C
00215 C*    3. End of routine
00216 C        --------------
00217 C
00218       IF (nlogprt .GE. 2) THEN
00219           WRITE (UNIT = nulou,FMT = *) ' '
00220           WRITE (UNIT = nulou,FMT = *) 
00221      $    '          --------- End of ROUTINE postpro ---------'
00222           CALL FLUSH (nulou)
00223       ENDIF
00224       RETURN
00225       END
 All Data Structures Namespaces Files Functions Variables Defines