main.f

            PROGRAM algSearch
      ************************************************************************
      * Analogue Search Program
      * 
   5: * Sebastian Kopf 2006
      * Coding Standards used approximately:
      * http://dbwww.essc.psu.edu/lasdoc/programmer/4fortran.html
      *
      * Program controlled via Makefile
  10: * Usage described in INSTALL.TXT
      *
      * All subroutines and functions described in their headers.
      *
      ************************************************************************
  15: 
            IMPLICIT none
      *     Main routine for the entire program of climate analogue search
      
            INTEGER x, y, futX, futY, a !grid size
  20:       INTEGER tX, tY ! transformation grid size for visualisation
            INTEGER curYearOffset, futYearOffset
            INTEGER citynum
            PARAMETER(citynum=25) !max number of cities read
            CHARACTER*50 cityName(citynum) !cities
  25:       REAL cityLat(citynum), cityLon(citynum) !cities' coordinates
      
            INTEGER method !method to use when searching for analogues
            
            ! whether to create the overview, pvalue table and individual visulisation maps
  30:       LOGICAL overview, table, visualisation 
            
            INTEGER strlen, i !funcs and looping var
            CHARACTER cityF*100, configF*100, line*50, eq*20, q*3 !config reads
            CHARACTER resultsP*100 ! results path
  35:       CHARACTER model*50 !model
             
            EXTERNAL processModel
             
            ! read model configuration
  40:       configF = "model.conf"
            print *, "Reading configuration file ",
           c      "'", configF(1:strlen(configF)),
           c      "'..." 
           
  45:       ! read it
            OPEN (11,file=configF(1:strlen(configF)))
                  read(11,*) line ! starting line
                  read(11,*) line, eq, method
                  read(11,*) line, eq, q
  50:             if (q=="yes") overview=.TRUE.
                  if (q=="no") overview=.FALSE.
                  read(11,*) line, eq, q
                  if (q=="yes") table=.TRUE.
                  if (q=="no") table=.FALSE.
  55:             read(11,*) line, eq, q
                  if (q=="yes") visualisation=.TRUE.
                  if (q=="no") visualisation=.FALSE.
                  read(11,*) line, eq, resultsP
                  resultsP=resultsP(1:strlen(resultsP))//"/" ! in case it got stripped
  60:             read(11,*) line, eq, model
                  read(11,*) line, eq, x
                  read(11,*) line, eq, y
                  read(11,*) line, eq, futX
                  read(11,*) line, eq, futY
  65:             read(11,*) line, eq, tX
                  read(11,*) line, eq, tY
                  read(11,*) line, eq, a
                  read(11,*) line, eq, curYearOffset
                  read(11,*) line, eq, futYearOffset
  70:       CLOSE(11)      
             
             
            ! read cities configuration
            cityF = "cities.conf"
  75:       print *, "Reading cities' configuration file ",
           c      "'", cityF(1:strlen(cityF)),
           c      "'..." 
      
            ! read it
  80:       i = 1
            OPEN (11,file=cityF(1:strlen(cityF)))
               READ(11,*,end=15) line ! starting line
        14     READ(11,*,end=15) cityName(i), cityLat(i), cityLon(i)
               i = i + 1
  85:          goto 14
        15  CLOSE(11)
      
            
            print *, "Processing model ", 
  90:      c      "'", model(1:strlen(model)), 
           c      "' for", i-1, " cities..."
      
            CALL processModel(
           c      overview, table, visualisation, method, 
  95:      c      resultsP, model,
           c      x,y,futX,futY,tX,tY,a,
           c      curYearOffset,futYearOffset,
           c      i-1, cityName, cityLat, cityLon )
            
 100:       END
            


Info Section
Warning: externals (function calls) may not be acurate calls: processmodel
back to top
f2html v0.3 (C) 1997,98 Beroud Jean-Marc. Fri Aug 11 17:54:58 CEST 2006