Ignore:
Timestamp:
Jul 21, 2000, 10:28:19 AM (24 years ago)
Author:
lmdzadmin
Message:

Rajout interface ocean couple

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/oasis.F

    r101 r105  
    1 c
     1C $Id$
    22C****
    3 C               *****************
    4 C               * OASIS ROUTINE *
    5 C               * ------------- *
    6 C               *****************
    73C
    84C**** *INICMA*  - Initialize coupled mode communication for atmosphere
    9 C
    10 C     Purpose:
    11 C     -------
    12 C     Exchange process identifiers and timestep information
    13 C     between AGCM, OGCM and COUPLER.
     5C                 and exchange some initial information with Oasis
    146C
    157C     Input:
     
    179C       KASTP  : total number of timesteps in atmospheric model
    1810C       KEXCH  : frequency of exchange (in time steps)
    19 C       KSTEP  : timestep value (in seconds)
    20 C
    21 C     Method:
    22 C     ------
    23 C     Use named pipes(FIFO) to exchange process identifiers
    24 C     between the programs
    25 C
    26 C     Externals:
    27 C     ---------
    28 C     GETPID, MKNOD
    29 C
    30 C     Reference:
    31 C     ---------
    32 C     See Epicoa 0803 (1992)
    33 C
    34 C     Author:
    35 C     -------
    36 C     Laurent Terray  92-09-01
     11C       KSTEP  : length of timestep (in seconds)
    3712C
    3813C     -----------------------------------------------------------
     
    4015      SUBROUTINE inicma(kastp,kexch,kstep)
    4116c
     17      INCLUDE 'param.h'
     18c
    4219      INTEGER kastp, kexch, kstep
    43 c
    44       INTEGER ime
    45       PARAMETER (ime = 1)
    46 
    4720      INTEGER iparal(3)
    48       INTEGER ifcpl, idt, info, imxtag, istep
    49 c
    50 #include "dimensions.h"
    51 #include "dimphy.h"
    52 #include "oasis.h"
    53 #include "clim.h"
    54 c
    55 c     Addition for SIPC CASE
    56 #include "param_sipc.h"
    57 #include "param_cou.h"
    58 #include "inc_sipc.h"
    59 #include "inc_cpl.h"
    60       CHARACTER*9 clpoolnam
    61       INTEGER ipoolhandle, imrc, ipoolsize, index, jf
     21      INTEGER ifcpl, idt, info, imxtag, istep, jf
     22c
     23      INCLUDE 'param_cou.h'
     24      INCLUDE 'inc_cpl.h'
    6225      CHARACTER*3 cljobnam      ! experiment name
    6326      CHARACTER*6 clmodnam      ! model name
     27c     EM: not used by Oasis2.4
     28CEM      CHARACTER*6 clbid(2)      ! for CLIM_Init call (not used)
     29CEM                                ! must be dimensioned by the number of models
     30CEM      INTEGER nbid(2)           ! for CLIM_Init call (not used)
     31CEM                                ! must be dimensioned by the number of models
    6432      CHARACTER*5 cloasis       ! coupler name (Oasis)
    65       INTEGER imess(4), imesso(4)
    66       INTEGER getpid, mknod ! system functions
    67       CHARACTER*80 clcmd
    68       CHARACTER*8 pipnom, fldnom
    69       INTEGER ierror, iretcode
    70 C
     33      INTEGER imess(4)
     34      INTEGER getpid            ! system functions
    7135      INTEGER nuout
     36CEM      LOGICAL llmodel
    7237      PARAMETER (nuout = 6)
    7338c
    74 C
    75 c
    76 
     39      INCLUDE 'clim.h'
     40      INCLUDE 'mpiclim.h'
     41c
     42      INCLUDE 'oasis.h' ! contains the name of communication technique. Here
     43                        ! cchan=CLIM only is possible.
     44c                       ! ctype=MPI2
     45c
    7746C     -----------------------------------------------------------
    7847C
     
    8756      WRITE(nuout,*) ' '
    8857c
    89 c     1.2.1-Define the model name
    90 c
    91       clmodnam = 'lmd.xx'       ! as $NBMODEL in namcouple
    92 c
    93 c     1.2.2-Define the coupler name
    94 c
    95       cloasis = 'Oasis'        !  as in coupler
    96 c
    97 c
    98 c     1.3.1-Define symbolic name for fields exchanged from atmos to coupler,
     58c     Define the model name
     59c
     60      clmodnam = 'toyatm'       ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
     61c
     62c     Define the coupler name
     63c
     64      cloasis = 'Oasis'        !  always 'Oasis' as in the coupler
     65c
     66c
     67c     Define symbolic name for fields exchanged from atmos to coupler,
    9968c         must be the same as (1) of the field  definition in namcouple:
    10069c
    101       cl_writ(1)='CONSFTOT'
    102       cl_writ(2)='COSHFTOT'
    103       cl_writ(3)='COTOPRSU'
    104       cl_writ(4)='COTFSHSU'
    105       cl_writ(5)='CORUNCOA'
    106       cl_writ(6)='CORIVFLU'
    107       cl_writ(7)='COZOTAUX'
    108       cl_writ(8)='COZOTAU2'
    109       cl_writ(9)='COMETAUY'
    110       cl_writ(10)='COMETAU2'
    111 c
    112 c     1.3.2-Define files name for fields exchanged from atmos to coupler,
     70      cl_writ(1)='COSHFICE'
     71      cl_writ(2)='COSHFOCE'
     72      cl_writ(3)='CONSFICE'
     73      cl_writ(4)='CONSFOCE'
     74      cl_writ(5)='CODFLXDT'
     75c      cl_writ(6)='COICTEMP'
     76      cl_writ(6)='COTFSICE'
     77      cl_writ(7)='COTFSOCE'
     78      cl_writ(8)='COTOLPSU'
     79      cl_writ(9)='COTOSPSU'
     80      cl_writ(10)='CORUNCOA'
     81      cl_writ(11)='CORIVFLU'
     82      cl_writ(12)='COZOTAUX'
     83      cl_writ(13)='COZOTAUV'
     84      cl_writ(14)='COMETAUY'
     85      cl_writ(15)='COMETAUU'
     86c
     87c     Define files name for fields exchanged from atmos to coupler,
    11388c         must be the same as (6) of the field  definition in namcouple:
    11489c
    115       cl_f_writ(1)='atmflx'
    116       cl_f_writ(2)='atmflx'
    117       cl_f_writ(3)='atmflx'
    118       cl_f_writ(4)='atmflx'
    119       cl_f_writ(5)='atmflx'
    120       cl_f_writ(6)='atmflx'
    121       cl_f_writ(7)='atmtau'
    122       cl_f_writ(8)='atmtau'
    123       cl_f_writ(9)='atmtau'
    124       cl_f_writ(10)='atmtau'
    125 c
    126 c
    127 c     1.4.1-Define symbolic name for fields exchanged from coupler to atmosphere,
     90      cl_f_writ(1)='flxatmos'
     91      cl_f_writ(2)='flxatmos'
     92      cl_f_writ(3)='flxatmos'
     93      cl_f_writ(4)='flxatmos'
     94      cl_f_writ(5)='flxatmos'
     95      cl_f_writ(6)='flxatmos'
     96      cl_f_writ(7)='flxatmos'
     97      cl_f_writ(8)='flxatmos'
     98      cl_f_writ(9)='flxatmos'
     99      cl_f_writ(10)='flxatmos'
     100      cl_f_writ(11)='flxatmos'
     101      cl_f_writ(12)='flxatmos'
     102      cl_f_writ(13)='flxatmos'
     103      cl_f_writ(14)='flxatmos'
     104      cl_f_writ(15)='flxatmos'
     105c      cl_f_writ(16)='flxatmos'
     106c
     107c
     108c     Define symbolic name for fields exchanged from coupler to atmosphere,
    128109c         must be the same as (2) of the field  definition in namcouple:
    129110c
    130       cl_read(1)='SISUTESU'
     111      cl_read(1)='SISUTESW'
    131112      cl_read(2)='SIICECOV'
    132 c
    133 c     1.4.2-Define files names for fields exchanged from coupler to atmosphere,
     113      cl_read(3)='SIICEALW'
     114      cl_read(4)='SIICTEMW'
     115c
     116c     Define files names for fields exchanged from coupler to atmosphere,
    134117c         must be the same as (7) of the field  definition in namcouple:
    135118c
    136       cl_f_read(1)='atmsst'
    137       cl_f_read(2)='atmice'
    138 c
    139 c     1.5-Define infos for sending to oasis
    140 c
    141       imess(1) = kastp
    142       imess(2) = kexch
    143       imess(3) = kstep
    144       imess(4) = getpid()
    145 
    146 c
    147 c
    148       IF (cchan.eq.'PIPE') THEN
    149 c
    150           ierror=0
    151 c
    152 c
    153           WRITE(nuout,*) ' '
    154           WRITE(nuout,*) 'Making pipes for fields to receive from CPL'
    155           WRITE(nuout,*) ' '
    156 c
    157 c loop to define pipes (ocean=CPL to atmos)
    158 c
    159           DO jf=1, jpfldo2a
    160             CALL PIPE_Model_Define(nuout, cl_read(jf), jpread, iretcode)
    161             IF (iretcode.ne.0) ierror=ierror+1
    162           END DO
    163 c
    164           WRITE(nuout,*) ' '
    165           WRITE(nuout,*) 'Making pipes for fields to send to CPL'
    166           WRITE(nuout,*) ' '
    167 c
    168 c loop to define pipes (atmos to ocean=CPL)
    169 c
    170           DO jf=1, jpflda2o
    171             CALL PIPE_Model_Define(nuout, cl_writ(jf), jpwrit, iretcode)
    172             IF (iretcode.ne.0) ierror=ierror+1
    173           END DO
    174 c
    175           IF (ierror.ne.0) THEN
    176               WRITE (nuout,*) 'Error in pipes definitions'
    177               WRITE (nuout,*) 'STOP inicma'
    178               CALL abort
    179           END IF
    180 c
    181           WRITE(nuout,*) ' '
    182           WRITE(nuout,*) 'All pipes have been made'
    183           WRITE(nuout,*) ' '
    184 c
    185           WRITE(nuout,*) ' '
    186           WRITE(nuout,*) 'Communication test between ATM and CPL'
    187           WRITE(nuout,*) ' '
    188           CALL flush(nuout)
    189 c
    190           CALL PIPE_Model_Stepi(nuout, imess, ime, imesso, ierror)
    191 c
    192           IF (ierror.ne.0) THEN
    193               WRITE (nuout,*)
    194      $            'Error in exchange first informations with Oasis'
    195               WRITE (nuout,*) 'STOP inicma'
    196               CALL abort
    197           END IF
    198 c
    199           WRITE(nuout,*) ' '
    200           WRITE(nuout,*) 'Communication test between ATM and CPL is OK'
    201           WRITE(nuout,*) ' total simulation time in oasis = ', imesso(1)
    202           WRITE(nuout,*) ' total number of iterations is  = ', imesso(2)
    203           WRITE(nuout,*) ' value of oasis timestep  is    = ', imesso(3)
    204           WRITE(nuout,*) ' process id for oasis  is       = ', imesso(4)
    205           WRITE(nuout,*) ' '
    206           CALL flush(nuout)
    207 c
    208       ELSE  IF (cchan.eq.'SIPC') THEN
    209 c
    210 c debug for more information
    211 c
    212 c          CALL SVIPC_debug(1)
    213 
    214 c
    215 c     1.1-Define the experiment name :
    216 c
    217           cljobnam = 'IPC'      ! as $JOBNAM in namcouple
    218 c
    219 c         3-Attach to shared memory pool used to exchange initial infos
    220 c
    221           imrc = 0
    222           CALL SIPC_Init_Model (cljobnam, clmodnam, 1, imrc)
    223           IF (imrc .NE. 0) THEN
    224             WRITE (nuout,*)'   '
    225             WRITE (nuout,*)'WARNING: Problem with attachement to', imrc
    226             WRITE (nuout,*)'         initial memory pool(s) in atmos'
    227             WRITE (nuout,*)'   '
    228             CALL ABORT('STOP in atmos')
    229           ENDIF
    230 c
    231 c         4-Attach to pools used to exchange fields from atmos to coupler
    232 c
    233           DO jf = 1, jpflda2o
    234 c
    235 C
    236 c           Pool name:
    237             clpoolnam = 'P'//cl_writ(jf)
    238 C
    239             CALL SIPC_Attach(clpoolnam, ipoolhandle)
    240 c     
    241 c           Resulting pool handle:
    242             mpoolwrit(jf) = ipoolhandle 
    243 C
    244             END DO
    245 C
    246 c         5-Attach to pools used to exchange fields from coupler to atmos
    247 c
    248           DO jf = 1, jpfldo2a
    249 c
    250 c           Pool name:
    251             clpoolnam = 'P'//cl_read(jf)
    252 c
    253             CALL SIPC_Attach(clpoolnam, ipoolhandle)
    254 c
    255 c           Resulting pool handle:
    256             mpoolread(jf) = ipoolhandle 
    257 c
    258           END DO
    259 c
    260 c         6-Exchange of initial infos
    261 c
    262 c         Write data array isend to pool READ by Oasis
    263 c
    264           imrc = 0
    265           ipoolsize = 4*jpbyteint
    266           CALL SVIPC_Write(mpoolinitr, imess, ipoolsize, imrc)
    267 C
    268 C         Find error if any
    269 C
    270           IF (imrc .LT. 0) THEN
    271               WRITE (nuout,*) '   '
    272               WRITE (nuout,*) 'Problem in atmos in writing initial'
    273               WRITE (nuout,*) 'infos to the shared memory segment(s)'
    274               WRITE (nuout,*) '   '
    275           ELSE
    276               WRITE (nuout,*) '   '
    277               WRITE (nuout,*) 'Initial infos written in atmos'           
    278               WRITE (nuout,*) 'to the shared memory segment(s)'
    279               WRITE (nuout,*) '   '
    280           ENDIF
    281 C
    282 C         Read data array irecv from pool written by Oasis
    283 C
    284           imrc = 0
    285           ipoolsize = 4*jpbyteint
    286           CALL SVIPC_Read(mpoolinitw, imesso, ipoolsize, imrc)
    287 C
    288 C*        Find error if any
    289 C
    290           IF (imrc .LT. 0) THEN
    291               WRITE (nuout,*) '   '
    292               WRITE (nuout,*) 'Problem in atmos in reading initial'
    293               WRITE (nuout,*) 'infos from the shared memory segment(s)'
    294               WRITE (nuout,*) '   '
    295           ELSE
    296               WRITE (nuout,*) '   '
    297               WRITE (nuout,*) 'Initial infos read by atmos'               
    298               WRITE (nuout,*) 'from the shared memory segment(s)'
    299               WRITE (nuout,*) '   '
    300               WRITE(*,*) ' ntime, niter, nstep, Oasis pid:'
    301               WRITE(*,*) imesso(1), imesso(2), imesso(3), imesso(4)
    302           ENDIF
    303 C
    304 C         Detach from shared memory segment(s)
    305 C
    306           imrc = 0
    307           CALL SVIPC_close(mpoolinitw, 0, imrc)
    308 C
    309 C         Find error if any
    310 C
    311           IF (imrc .LT. 0) THEN
    312               WRITE (nuout,*)
    313      $          'Problem in detaching from shared memory segment(s)'
    314               WRITE (nuout,*)
    315      $          'used by atmos to read initial infos'
    316           ENDIF
    317 c
    318 c
    319       ELSE IF (cchan.eq.'CLIM') THEN
    320 
    321 c
    322 c     1.1-Define the experiment name :
     119      cl_f_read(1)='sstatmos'
     120      cl_f_read(2)='sstatmos'
     121      cl_f_read(3)='sstatmos'
     122      cl_f_read(4)='sstatmos'
     123c
     124c
     125c     Define the number of processors involved in the coupling for
     126c     Oasis (=1) and each model (as last two INTEGER on $CHATYPE line
     127c     in the namcouple); they will be stored in a COMMON in mpiclim.h
     128c     (used for CLIM/MPI2 only)
     129      mpi_nproc(0)=1
     130      mpi_nproc(1)=1
     131      mpi_nproc(2)=1
     132c
     133c     Define infos to be sent initially to oasis
     134c
     135      imess(1) = kastp      ! total number of timesteps in atmospheric model
     136      imess(2) = kexch      ! period of exchange (in time steps)
     137      imess(3) = kstep      ! length of atmospheric timestep (in seconds)
     138      imess(4) = getpid()   ! PID of atmospheric model
     139c
     140c     Initialization and exchange of initial info in the CLIM technique
     141c
     142      IF (cchan.eq.'CLIM') THEN
     143c
     144c     Define the experiment name :
    323145c
    324146          cljobnam = 'CLI'      ! as $JOBNAM in namcouple
    325 
    326           OPEN ( UNIT = 7, FILE = 'trace', STATUS = 'unknown',
    327      $          FORM = 'formatted')
     147c
     148c         Start the coupling
     149c         (see lib/clim/src/CLIM_Init for the definition of input parameters)
     150c
     151cEM          clbid(1)='      '
     152cEM          clbid(2)='      '
     153cEM          nbid(1)=0
     154cEM          nbid(2)=0
     155CEM          llmodel=.true.
     156c
     157c         Define the number of processors used by each model as in
     158c         $CHATYPE line of namcouple (used for CLIM/MPI2 only)
     159          mpi_totproc(1)=1
     160          mpi_totproc(2)=1
     161c
     162c         Define names of each model as in $NBMODEL line of namcouple
     163c         (used for CLIM/MPI2 only)       
     164          cmpi_modnam(1)='toyatm'
     165          cmpi_modnam(2)='toyoce'
     166c         Start the coupling
     167c
    328168          CALL CLIM_Init ( cljobnam, clmodnam, 3, 7,
    329169     *                 kastp, kexch, kstep,
    330170     *                 5, 3600, 3600, info )
    331171c
    332           IF (info.ne.clim_ok) THEN
     172          IF (info.ne.CLIM_Ok) THEN
    333173              WRITE ( nuout, *) ' inicma : pb init clim '
    334174              WRITE ( nuout, *) ' error code is = ', info
    335               CALL abort('STOP in inicma')
     175              CALL halte('STOP in inicma')
    336176            ELSE
    337177              WRITE(nuout,*) 'inicma : init clim ok '
    338178          ENDIF
    339179c
    340           iparal ( clim_strategy ) = clim_serial
    341           iparal ( clim_length   ) = iim*(jjm+1)
     180c         For each coupling field, association of a port to its symbolic name
     181c
     182c         -Define the parallel decomposition associated to the port of each
     183c          field; here no decomposition for all ports.
     184          iparal ( clim_strategy ) = clim_serial
     185          iparal ( clim_length   ) = imjm
    342186          iparal ( clim_offset   ) = 0
    343187c
    344 c loop to define messages (CPL=ocean to atmos)
    345 c
     188c         -Loop on total number of coupler-to-atmosphere fields
     189c         (see lib/clim/src/CLIM_Define for the definition of input parameters)
    346190          DO jf=1, jpfldo2a
    347191            CALL CLIM_Define (cl_read(jf), clim_in , clim_double, iparal
    348192     $          , info ) 
    349193          END DO
    350 
    351 c
    352 c loop to define messages (atmos to ocean=CPL)
    353 c
    354           DO jf=1, jpflda2o
     194c
     195c         -Loop on total number of atmosphere-to-coupler fields
     196c         (see lib/clim/src/CLIM_Define for the definition of input parameters)
     197          DO jf=1, jpflda2o1+jpflda2o2
    355198            CALL CLIM_Define (cl_writ(jf), clim_out , clim_double,
    356199     $          iparal, info )   
    357200          END DO
    358 
     201c
    359202          WRITE(nuout,*) 'inicma : clim_define ok '
     203c
     204c         -Join a pvm group, wait for other programs and broadcast usefull
     205c          informations to Oasis and to the ocean (see lib/clim/src/CLIM_Start)
    360206          CALL CLIM_Start ( imxtag, info )
    361207          IF (info.ne.clim_ok) THEN
    362208              WRITE ( nuout, *) 'inicma : pb start clim '
    363209              WRITE ( nuout, *) ' error code is = ', info
    364               CALL abort('stop in inicma')
     210              CALL halte('stop in inicma')
    365211            ELSE
    366212              WRITE ( nuout, *)  'inicma : start clim ok '
    367213          ENDIF
    368214c
     215c         -Get initial information from Oasis
     216c          (see lib/clim/src/CLIM_Stepi)
    369217          CALL CLIM_Stepi (cloasis, istep, ifcpl, idt, info)
    370218          IF (info .NE. clim_ok) THEN
     
    386234      END
    387235
    388       SUBROUTINE fromcpl(kt, imjm, sst,sic, alb_sst, alb_sic )
     236c $Id$
     237      SUBROUTINE fromcpl(kt, imjm, sst, gla, tice, albedo)
     238c ======================================================================
     239c S. Valcke (02/99) adapted From L.Z.X Li: this subroutine reads the SST
     240c and Sea-Ice provided by the coupler with the CLIM (PVM exchange messages)
     241c technique.
     242c======================================================================
    389243      IMPLICIT none
    390 c
    391 c Laurent Z.X Li (Feb. 10, 1997): It reads the SST and Sea-Ice
    392 c provided by the coupler. Of course, it waits until it receives
    393 c the signal from the corresponding pipes.
    394 c 3 techniques:
    395 c  - pipes and signals (only on Cray C90 and Cray J90)
    396 c  - CLIM (PVM exchange messages)
    397 c  - SVIPC shared memory segments and semaphores
    398 c
    399244      INTEGER imjm, kt
    400245      REAL sst(imjm)          ! sea-surface-temperature
    401       REAL alb_sst(imjm)  ! open sea albedo
    402       REAL sic(imjm)      ! sea ice cover
    403       REAL alb_sic(imjm)  ! sea ice albedo
    404 
     246      REAL gla(imjm)          ! sea-ice
     247      REAL tice(imjm)          ! temp glace
     248      REAL albedo(imjm)          ! albedo glace
    405249c
    406250      INTEGER nuout             ! listing output unit
     
    408252c
    409253      INTEGER nuread, ios, iflag, icpliter
    410       CHARACTER*8 pipnom        ! name for the pipe
    411       CHARACTER*8 fldnom        ! name for the field
    412       CHARACTER*8 filnom        ! name for the data file
    413 
    414254      INTEGER info, jf
    415 
    416 c
    417 #include "oasis.h"
    418 #include "clim.h"
    419 c
    420 #include "param_cou.h"
    421 c
    422 #include "inc_sipc.h"
    423 #include "inc_cpl.h"
    424 c
    425 c     Addition for SIPC CASE
    426       INTEGER index
    427       CHARACTER*3 cmodinf       ! Header or not
    428       CHARACTER*3 cljobnam_r    ! Experiment name in the field brick, if any
    429       INTEGER infos(3)          ! infos in the field brick, if any
     255c
     256      INCLUDE 'clim.h'
     257c
     258      INCLUDE 'oasis.h'
     259      INCLUDE 'param_cou.h'
     260c
     261      INCLUDE 'inc_cpl.h'
    430262c
    431263c
    432264      WRITE (nuout,*) ' '
    433       WRITE (nuout,*) 'Fromcpl: Read fields from CPL, kt=',kt
     265      WRITE (nuout,*) 'Fromcpl: Reading fields from CPL, kt=',kt
    434266      WRITE (nuout,*) ' '
    435267      CALL flush (nuout)
    436268
    437       IF (cchan.eq.'PIPE') THEN
    438 c
    439 c UNIT number for fields
    440 c
    441           nuread = 99
    442 c
    443 c exchanges from ocean=CPL to atmosphere
     269
     270      IF (cchan.eq.'CLIM') THEN
     271
     272c
     273c     -Get interpolated oceanic fields from Oasis
    444274c
    445275          DO jf=1,jpfldo2a
    446             CALL PIPE_Model_Recv(cl_read(jf), icpliter, nuout)
    447             OPEN (nuread, FILE=cl_f_read(jf), FORM='UNFORMATTED')
    448             IF (jf.eq.1)
    449      $          CALL locread(cl_read(jf), sst, imjm, nuread, iflag,
    450      $          nuout)
    451             IF (jf.eq.2)
    452      $          CALL locread(cl_read(jf), sic, imjm, nuread, iflag,
    453      $          nuout)
    454             IF (jf.eq.3)
    455      $          CALL locread(cl_read(jf), alb_sst, imjm, nuread, iflag,
    456      $          nuout)
    457             IF (jf.eq.4)
    458      $          CALL locread(cl_read(jf), alb_sic, imjm, nuread, iflag,
    459      $          nuout)
    460             CLOSE (nuread)
    461           END DO
    462 
    463 c
    464       ELSE IF (cchan.eq.'SIPC') THEN
    465 c
    466 c         Define IF a header must be encapsulated within the field brick :
    467           cmodinf = 'NOT'                 ! as $MODINFO in namcouple 
    468 c
    469 c         reading of input field sea-surface-temperature SISUTESU
    470 c
    471 c
    472 c         Index of sst in total number of fields jpfldo2a:
    473           index = 1
    474 c
    475           CALL SIPC_Read_Model(index, imjm, cmodinf,
    476      $              cljobnam_r,infos, sst)
    477 c
    478 c         reading of input field sea-ice SIICECOV
    479 c
    480 c
    481 c         Index of sea-ice in total number of fields jpfldo2a:
    482           index = 2
    483 c
    484           CALL SIPC_Read_Model(index, imjm, cmodinf,
    485      $              cljobnam_r,infos, sic)
    486 c         Index of open sea albedo in total number of fields jpfldo2a:
    487           index = 3
    488 c
    489           CALL SIPC_Read_Model(index, imjm, cmodinf,
    490      $              cljobnam_r,infos, alb_sst)
    491 c         Index of sea-ice albedo in total number of fields jpfldo2a:
    492           index = 4
    493 c
    494           CALL SIPC_Read_Model(index, imjm, cmodinf,
    495      $              cljobnam_r,infos, alb_sic)
    496 c
    497 c
    498       ELSE IF (cchan.eq.'CLIM') THEN
    499 
    500 c
    501 c exchanges from ocean=CPL to atmosphere
    502 c
    503         DO jf=1,jpfldo2a
    504           IF (jf.eq.1) CALL CLIM_Import (cl_read(jf) , kt, sst, info)
    505           IF (jf.eq.2) CALL CLIM_Import (cl_read(jf) , kt, sic, info)
    506          IF (jf.eq.3) CALL CLIM_Import (cl_read(jf) , kt, alb_sst, info)
    507          IF (jf.eq.4) CALL CLIM_Import (cl_read(jf) , kt, alb_sic, info)
    508           IF ( info .NE. CLIM_Ok) THEN
     276            IF (jf.eq.1) CALL CLIM_Import (cl_read(jf) , kt, sst, info)
     277            IF (jf.eq.2) CALL CLIM_Import (cl_read(jf) , kt, gla, info)
     278            IF (jf.eq.3) CALL CLIM_Import (cl_read(jf), kt,albedo, info)
     279            IF (jf.eq.4) CALL CLIM_Import (cl_read(jf) , kt, tice, info)
     280            IF ( info .NE. CLIM_Ok) THEN
    509281                WRITE(nuout,*)'Pb in reading ', cl_read(jf), jf
    510282                WRITE(nuout,*)'Couplage kt is = ',kt
    511283                WRITE(nuout,*)'CLIM error code is = ', info
    512                 WRITE(nuout,*)'STOP in Fromcpl'
    513                 STOP 'Fromcpl'
     284                CALL halte('STOP in fromcpl.F')
    514285            ENDIF
    515286          END DO
     
    520291      END
    521292
    522 
    523       SUBROUTINE intocpl(kt,imjm,
    524      .                   fsol, fnsol,
    525      .                   rain, snow, evap, ruisoce, ruisriv,
    526      .                   taux, tauy, last)
     293c $Id$
     294      SUBROUTINE intocpl(kt, imjm, fsolice, fsolwat, fnsolice, fnsolwat,
     295     $    fnsicedt, evice, evwat, lpre, spre, dirunoff, rivrunoff,
     296     $    tauxu, tauxv, tauyv, tauyu, last)
     297c ======================================================================
     298c S. Valcke (02/99) adapted From L.Z.X Li: this subroutine provides the
     299c atmospheric coupling fields to the coupler with the CLIM (PVM exchange
     300c messages) technique.
     301c IF last time step, writes output fields to binary files.
     302c ======================================================================
    527303      IMPLICIT NONE
    528 c
    529 c Laurent Z.X Li (Feb. 10, 1997): It provides several fields to the
    530 c coupler. Of course, it sends a message to the corresponding pipes
    531 c after the writting.
    532 c 3 techniques : pipes
    533 c                clim
    534 c                svipc
    535 c IF last time step WRITE output files anway
    536 c
    537 #include "oasis.h"
    538 
    539304      INTEGER kt, imjm
    540305c
    541       REAL fsol(imjm)
    542       REAL fnsol(imjm)
    543       REAL rain(imjm)
    544       REAL snow(imjm)
    545       REAL evap(imjm)
    546       REAL ruisoce(imjm)
    547       REAL ruisriv(imjm)
    548       REAL taux(imjm)
    549       REAL tauy(imjm)
     306      REAL fsolice(imjm)
     307      REAL fsolwat(imjm)
     308      REAL fnsolice(imjm)
     309      REAL fnsolwat(imjm)
     310      REAL fnsicedt(imjm)
     311      REAL ictemp(imjm)
     312      REAL evice(imjm)
     313      REAL evwat(imjm)
     314      REAL lpre(imjm)
     315      REAL spre(imjm)
     316      REAL dirunoff(imjm)
     317      REAL rivrunoff(imjm)
     318      REAL tauxu(imjm)
     319      REAL tauxv(imjm)
     320      REAL tauyu(imjm)
     321      REAL tauyv(imjm)
    550322      LOGICAL last
    551323c
     
    553325      PARAMETER (nuout = 6)
    554326c
    555 c Additions for SVIPC
    556 c
    557       INTEGER index
    558       INTEGER infos(3)
    559       CHARACTER*3 cmodinf       ! Header or not
    560       CHARACTER*3 cljobnam      ! experiment name
    561 c
    562 #include "clim.h"
    563 c
    564 #include "param_cou.h"
    565 c
    566 #include "inc_sipc.h"
    567 #include "inc_cpl.h"
    568 c
    569 C
    570       INTEGER nuwrit, ios
    571       CHARACTER*8 pipnom
    572       CHARACTER*8 fldnom
    573       CHARACTER*6 file_name(jpmaxfld)
     327      INCLUDE 'clim.h'
     328      INCLUDE 'param_cou.h'
     329      INCLUDE 'inc_cpl.h'
     330c
     331      CHARACTER*8 file_name(jpmaxfld)
    574332      INTEGER max_file
    575333      INTEGER file_unit_max, file_unit(jpmaxfld),
     
    579337      LOGICAL trouve
    580338c
     339      INCLUDE 'oasis.h'
    581340c
    582341      icstep=kt
    583342c
    584343      WRITE(nuout,*) ' '
    585       WRITE(nuout,*) 'Intocpl: send fields to CPL, kt= ', kt
     344      WRITE(nuout,*) 'Intocpl: sending fields to CPL, kt= ', kt
    586345      WRITE(nuout,*) ' '
    587346
    588       IF (last.or.(cchan.eq.'PIPE')) THEN
    589 c
    590 c
    591 c WRITE fields for coupler with pipe technique or for last time step
    592 c
    593 c         initialisation
     347      IF (last) THEN
     348c
     349c     -WRITE fields to binary files for coupler restart at last time step
     350c
     351c         -initialisation and files opening
    594352c
    595353          max_file=1
    596354          file_unit_max=99
    597 c keeps first file name
     355c         -keeps first file name
    598356          file_name(max_file)=cl_f_writ(max_file)
    599 c keeps first file unit
     357c         -keeps first file unit
    600358          file_unit(max_file)=file_unit_max
    601 c decrements file unit maximum
     359c         -decrements file unit maximum
    602360          file_unit_max=file_unit_max-1
    603 c keeps file unit for field
     361c         -keeps file unit for field
    604362          file_unit_field(1)=file_unit(max_file)
    605363c
    606 c different files names counter
    607 c
    608          
    609           DO jf= 2, jpflda2o
     364c         -different files names counter
     365c
     366          DO jf= 2, jpflda2o1 + jpflda2o2
    610367            trouve=.false.
    611368            DO jn= 1, max_file
    612369              IF (.not.trouve) THEN
    613370                  IF (cl_f_writ(jf).EQ.file_name(jn)) THEN
    614 c keep file unit for field
     371c                 -keep file unit for field
    615372                      file_unit_field(jf)=file_unit(jn)
    616373                      trouve=.true.
     
    619376            END DO
    620377            IF (.not.trouve) then
    621 c increment the number of different files
     378c           -increment the number of different files
    622379                max_file=max_file+1
    623 c keep file name
     380c           -keep file name
    624381                file_name(max_file)=cl_f_writ(jf)
    625 c keep file unit for file
     382c           -keep file unit for file
    626383                file_unit(max_file)=file_unit_max
    627 c keep file unit for field
     384c           -keep file unit for field
    628385                file_unit_field(jf)=file_unit(max_file)
    629 c decrement unit maximum number from 99 to 98, ...
     386c           -decrement unit maximum number from 99 to 98, ...
    630387                file_unit_max=file_unit_max-1
    631388            END IF
    632389          END DO
    633          
     390c         
    634391          DO jn=1, max_file
    635392            OPEN (file_unit(jn), FILE=file_name(jn), FORM='UNFORMATTED')
    636           END DO
    637          
    638           DO jf=1, jpflda2o
     393          END DO
     394c
     395c         WRITE fields to files         
     396          DO jf=1, jpflda2o1 + jpflda2o2
    639397            IF (jf.eq.1)
    640      $          CALL locwrite(cl_writ(jf),fnsol, imjm,
     398     $          CALL locwrite(cl_writ(jf),fsolice, imjm,
    641399     $          file_unit_field(jf), ierror, nuout)
    642400            IF (jf.eq.2)
    643      $          CALL locwrite(cl_writ(jf),fsol, imjm,
     401     $          CALL locwrite(cl_writ(jf),fsolwat, imjm,
    644402     $          file_unit_field(jf), ierror, nuout)
    645403            IF (jf.eq.3)
    646      $          CALL locwrite(cl_writ(jf),rain, imjm,
     404     $          CALL locwrite(cl_writ(jf),fnsolice, imjm,
    647405     $          file_unit_field(jf), ierror, nuout)
    648406            IF (jf.eq.4)
    649      $          CALL locwrite(cl_writ(jf),evap, imjm,
     407     $          CALL locwrite(cl_writ(jf),fnsolwat, imjm,
    650408     $          file_unit_field(jf), ierror, nuout)
    651409            IF (jf.eq.5)
    652      $          CALL locwrite(cl_writ(jf),ruisoce, imjm,
     410     $          CALL locwrite(cl_writ(jf),fnsicedt, imjm,
     411     $          file_unit_field(jf), ierror, nuout)
     412c            IF (jf.eq.6)
     413c     $          CALL locwrite(cl_writ(jf),ictemp, imjm,
     414c     $          file_unit_field(jf), ierror, nuout)
     415            IF (jf.eq.6)
     416     $          CALL locwrite(cl_writ(jf),evice, imjm,
     417     $          file_unit_field(jf), ierror, nuout)
     418            IF (jf.eq.7)
     419     $          CALL locwrite(cl_writ(jf),evwat, imjm,
     420     $          file_unit_field(jf), ierror, nuout)
     421            IF (jf.eq.8)
     422     $          CALL locwrite(cl_writ(jf),lpre, imjm,
     423     $          file_unit_field(jf), ierror, nuout)
     424            IF (jf.eq.9)
     425     $          CALL locwrite(cl_writ(jf),spre, imjm,
     426     $          file_unit_field(jf), ierror, nuout)
     427            IF (jf.eq.10)
     428     $          CALL locwrite(cl_writ(jf),dirunoff, imjm,
     429     $          file_unit_field(jf), ierror, nuout)
     430            IF (jf.eq.11)
     431     $          CALL locwrite(cl_writ(jf),rivrunoff, imjm,
     432     $          file_unit_field(jf), ierror, nuout)
     433            IF (jf.eq.12)
     434     $          CALL locwrite(cl_writ(jf),tauxu, imjm,
    653435     $          file_unit_field(jf),ierror, nuout)
    654             IF (jf.eq.6)
    655      $          CALL locwrite(cl_writ(jf),ruisriv, imjm,
     436            IF (jf.eq.13)
     437     $          CALL locwrite(cl_writ(jf),tauxv, imjm,
    656438     $          file_unit_field(jf),ierror, nuout)
    657             IF (jf.eq.7)
    658      $          CALL locwrite(cl_writ(jf),taux, imjm,
    659      $          file_unit_field(jf), ierror, nuout)
    660             IF (jf.eq.8)
    661      $          CALL locwrite(cl_writ(jf),taux, imjm,
    662      $          file_unit_field(jf), ierror, nuout)
    663             IF (jf.eq.9)
    664      $          CALL locwrite(cl_writ(jf),tauy, imjm,
    665      $          file_unit_field(jf), ierror, nuout)
    666             IF (jf.eq.10)
    667      $          CALL locwrite(cl_writ(jf),tauy, imjm,
    668      $          file_unit_field(jf), ierror, nuout)
    669           END DO
    670 C
    671 C simulate a FLUSH
     439            IF (jf.eq.14)
     440     $          CALL locwrite(cl_writ(jf),tauyv, imjm,
     441     $          file_unit_field(jf),ierror, nuout)
     442            IF (jf.eq.15)
     443     $          CALL locwrite(cl_writ(jf),tauyu, imjm,
     444     $          file_unit_field(jf), ierror, nuout)
     445          END DO
     446C
     447C         -simulate a FLUSH
    672448C
    673449          DO jn=1, max_file
    674450            CLOSE (file_unit(jn))
    675451          END DO
    676 c
    677 c
    678 c
     452C
     453C
    679454          IF(cchan.eq.'CLIM') THEN
    680 c
    681 c inform PVM daemon, I have finished
    682 c
     455C
     456C         -inform PVM daemon that message exchange is finished
     457C
    683458              CALL CLIM_Quit (CLIM_ContPvm, info)
    684459              IF (info .NE. CLIM_Ok) THEN
     
    687462     $                info
    688463              ENDIF
    689              
    690464          END IF
     465          RETURN   
     466      END IF
     467C
     468      IF(cchan.eq.'CLIM') THEN
     469C
     470C     -Give atmospheric fields to Oasis
     471C
     472          DO jn=1, jpflda2o1 + jpflda2o2
     473C           
     474          IF (jn.eq.1) CALL CLIM_Export(cl_writ(jn), kt, fsolice, info)
     475          IF (jn.eq.2) CALL CLIM_Export(cl_writ(jn), kt, fsolwat, info)
     476          IF (jn.eq.3) CALL CLIM_Export(cl_writ(jn), kt, fnsolice, info)
     477          IF (jn.eq.4) CALL CLIM_Export(cl_writ(jn), kt, fnsolwat, info)
     478          IF (jn.eq.5) CALL CLIM_Export(cl_writ(jn), kt, fnsicedt, info)
     479c          IF (jn.eq.6) CALL CLIM_Export(cl_writ(jn), kt, ictemp, info)
     480          IF (jn.eq.6) CALL CLIM_Export(cl_writ(jn), kt, evice, info)
     481          IF (jn.eq.7) CALL CLIM_Export(cl_writ(jn), kt, evwat, info)
     482          IF (jn.eq.8) CALL CLIM_Export(cl_writ(jn), kt, lpre, info)
     483          IF (jn.eq.9) CALL CLIM_Export(cl_writ(jn), kt, spre, info)
     484          IF (jn.eq.10) CALL CLIM_Export(cl_writ(jn),kt,dirunoff, info)
     485          IF (jn.eq.11) CALL CLIM_Export(cl_writ(jn),kt,rivrunoff,info)
     486          IF (jn.eq.12) CALL CLIM_Export(cl_writ(jn), kt, tauxu, info)
     487          IF (jn.eq.13) CALL CLIM_Export(cl_writ(jn), kt, tauxv, info)
     488          IF (jn.eq.14) CALL CLIM_Export(cl_writ(jn), kt, tauyv, info)
     489          IF (jn.eq.15) CALL CLIM_Export(cl_writ(jn), kt, tauyu, info)
    691490         
    692       END IF
    693      
    694 c
    695 c IF last we have finished
    696 c
    697       IF (last) RETURN
    698      
    699       IF (cchan.eq.'PIPE') THEN
    700 c
    701 c Send message to pipes for CPL=ocean
    702 c
    703           DO jf=1, jpflda2o
    704             CALL PIPE_Model_Send(cl_writ(jf), kt, nuout)
    705           END DO
    706 c
    707 c
    708 c
    709       ELSE  IF(cchan.eq.'SIPC') THEN
    710 c
    711 c         Define IF a header must be encapsulated within the field brick :
    712           cmodinf = 'NOT'                 ! as $MODINFO in namcouple 
    713 c
    714 c         IF cmodinf = 'YES', define encapsulated infos to be exchanged
    715 c                 infos(1) = initial date
    716 c                 infos(2) = timestep
    717 c                 infos(3) = actual time
    718 c
    719 c         Writing of output field non solar heat flux CONSFTOT
    720 c
    721 c         Index of non solar heat flux in total number of fields jpflda2o:
    722           index = 1
    723 c   
    724           CALL SIPC_Write_Model(index, imjm, cmodinf,
    725      $                          cljobnam,infos,fnsol)
    726 c
    727 c
    728 c         Writing of output field solar heat flux COSHFTOT
    729 c
    730 c         Index of solar heat flux in total number of fields jpflda2o:
    731           index = 2
    732 c   
    733           CALL SIPC_Write_Model(index, imjm, cmodinf,
    734      $                          cljobnam,infos,fsol)
    735 c
    736 c         Writing of output field rain COTOPRSU
    737 c
    738 c         Index of rain in total number of fields jpflda2o:
    739           index = 3
    740 c   
    741           CALL SIPC_Write_Model(index, imjm, cmodinf,
    742      $                          cljobnam,infos, rain)
    743 c
    744 c         Writing of output field evap COTFSHSU
    745 c
    746 c         Index of evap in total number of fields jpflda2o:
    747           index = 4
    748 c   
    749           CALL SIPC_Write_Model(index, imjm, cmodinf,
    750      $                          cljobnam,infos, evap)
    751 c
    752 c         Writing of output field ruisoce CORUNCOA
    753 c
    754 c         Index of ruisoce in total number of fields jpflda2o:
    755           index = 5
    756 c   
    757           CALL SIPC_Write_Model(index, imjm, cmodinf,
    758      $                          cljobnam,infos, ruisoce)
    759 c
    760 c
    761 c         Writing of output field ruisriv CORIVFLU
    762 c
    763 c         Index of ruisriv in total number of fields jpflda2o:
    764           index = 6
    765 c   
    766           CALL SIPC_Write_Model(index, imjm, cmodinf,
    767      $                          cljobnam,infos, ruisriv)
    768 c
    769 c
    770 c         Writing of output field zonal wind stress COZOTAUX
    771 c
    772 c         Index of runoff in total number of fields jpflda2o:
    773           index = 7
    774 c   
    775           CALL SIPC_Write_Model(index, imjm, cmodinf,
    776      $                          cljobnam,infos, taux)
    777 c
    778 c         Writing of output field meridional wind stress COMETAUY
    779 c
    780 c         Index of runoff in total number of fields jpflda2o:
    781           index = 8
    782 c   
    783           CALL SIPC_Write_Model(index, imjm, cmodinf,
    784      $                          cljobnam,infos, taux)
    785 c
    786 c
    787 c         Writing of output field zonal wind stress COMETAU2 (at v point)
    788 c
    789 c         Index of runoff in total number of fields jpflda2o:
    790           index = 9
    791 c   
    792           CALL SIPC_Write_Model(index, imjm, cmodinf,
    793      $                          cljobnam,infos, tauy)
    794 c
    795 c         Writing of output field meridional wind stress COMETAU2
    796 c
    797 c         Index of runoff in total number of fields jpflda2o:
    798           index = 10
    799 c   
    800           CALL SIPC_Write_Model(index, imjm, cmodinf,
    801      $                          cljobnam,infos, tauy)
    802 c
    803 c
    804       ELSE IF(cchan.eq.'CLIM') THEN
    805          
    806           DO jn=1, jpflda2o
    807            
    808             IF (jn.eq.1) CALL CLIM_Export(cl_writ(jn), kt, fnsol, info)
    809             IF (jn.eq.2) CALL CLIM_Export(cl_writ(jn), kt, fsol, info)
    810             IF (jn.eq.3) CALL CLIM_Export(cl_writ(jn), kt, rain, info)
    811             IF (jn.eq.4) CALL CLIM_Export(cl_writ(jn), kt, evap, info)
    812             IF (jn.eq.5) CALL CLIM_Export(cl_writ(jn), kt, ruisoce, info
    813      $          )
    814             IF (jn.eq.6) CALL CLIM_Export(cl_writ(jn), kt, ruisriv, info
    815      $          )
    816             IF (jn.eq.7) CALL CLIM_Export(cl_writ(jn), kt, taux, info)
    817             IF (jn.eq.8) CALL CLIM_Export(cl_writ(jn), kt, taux, info)
    818             IF (jn.eq.9) CALL CLIM_Export(cl_writ(jn), kt, tauy, info)
    819             IF (jn.eq.10) CALL CLIM_Export(cl_writ(jn), kt, tauy, info)
    820            
    821491            IF (info .NE. CLIM_Ok) THEN
    822492                WRITE (nuout,*) 'STEP : Pb giving ',cl_writ(jn), ':',jn
    823493                WRITE (nuout,*) ' at timestep = ', icstep,'kt = ',kt
    824494                WRITE (nuout,*) 'Clim error code is = ',info
    825                 WRITE (nuout,*) 'STOP in intocpl '
    826                 CALL abort(' intocpl ')
     495                CALL halte('STOP in intocpl ')
    827496            ENDIF
    828            
    829           END DO
    830          
     497          END DO
    831498      ENDIF
    832 c
     499C
    833500      RETURN
    834501      END
    835502
    836       SUBROUTINE locread
    837       print *, 'Attention dans oasis.F, locread est non defini'
    838       RETURN
    839       END
    840 
    841       SUBROUTINE locwrite
    842       print *, 'Attention dans oasis.F, locwrite est non defini'
    843       RETURN
    844       END
    845 
    846       SUBROUTINE pipe_model_define
    847       print*,'Attention dans oasis.F, pipe_model_define est non defini'
    848       RETURN
    849       END
    850 
    851       SUBROUTINE pipe_model_stepi
    852       print*,'Attention dans oasis.F, pipe_model_stepi est non defini'
    853       RETURN
    854       END
    855 
    856       SUBROUTINE pipe_model_recv
    857       print *, 'Attention dans oasis.F, pipe_model_recv est non defini'
    858       RETURN
    859       END
    860 
    861       SUBROUTINE pipe_model_send
    862       print *, 'Attention dans oasis.F, pipe_model_send est non defini'
    863       RETURN
    864       END
    865 
    866 
    867       SUBROUTINE sipc_init_model
    868       print *, 'Attention dans oasis.F, sipc_init_model est non defini'
    869       RETURN
    870       END
    871 
    872       SUBROUTINE svipc_write
    873       print *, 'Attention dans oasis.F, svipc_write est non defini'
    874       RETURN
    875       END
    876 
    877       SUBROUTINE clim_export
    878       print *, 'Attention dans oasis.F, clim_export est non defini'
    879       RETURN
    880       END
    881 
    882       SUBROUTINE clim_init
    883       print *, 'Attention dans oasis.F, clim_init est non defini'
    884       RETURN
    885       END
    886 
    887       SUBROUTINE sipc_write_model
    888       print *, 'Attention dans oasis.F, sipc_write_model est non defini'
    889       RETURN
    890       END
    891 
    892       SUBROUTINE clim_start
    893       print *, 'Attention dans oasis.F, clim_start est non defini'
    894       RETURN
    895       END
    896 
    897       SUBROUTINE clim_define
    898       print *, 'Attention dans oasis.F, clim_define est non defini'
    899       RETURN
    900       END
    901 
    902       SUBROUTINE sipc_attach
    903       print *, 'Attention dans oasis.F, sipc_attach est non defini'
    904       RETURN
    905       END
    906 
    907       SUBROUTINE clim_import
    908       print *, 'Attention dans oasis.F, clim_import est non defini'
    909       RETURN
    910       END
    911 
    912       SUBROUTINE svipc_read
    913       print *, 'Attention dans oasis.F, svipc_read est non defini'
    914       RETURN
    915       END
    916 
    917       SUBROUTINE clim_stepi
    918       print *, 'Attention dans oasis.F, clim_stepi est non defini'
    919       RETURN
    920       END
    921 
    922       SUBROUTINE sipc_read_model
    923       print *, 'Attention dans oasis.F, sipc_read_model est non defini'
    924       RETURN
    925       END
    926 
    927       SUBROUTINE svipc_close
    928       print *, 'Attention dans oasis.F, svipc_close est non defini'
    929       RETURN
    930       END
    931 
    932       SUBROUTINE clim_quit
    933       print *, 'Attention dans oasis.F, clim_quit est non defini'
    934       RETURN
    935       END
    936 
Note: See TracChangeset for help on using the changeset viewer.