New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
corio2fb.F90 in branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/TOOLS/OBSTOOLS/src – NEMO

source: branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/TOOLS/OBSTOOLS/src/corio2fb.F90 @ 5985

Last change on this file since 5985 was 5985, checked in by timgraham, 8 years ago

Reinstate keywords before upgrading to head of trunk

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1PROGRAM corio2fb
2   !!---------------------------------------------------------------------
3   !!
4   !!                     ** PROGRAM corio2fb **
5   !!
6   !!  ** Purpose : Convert Coriolis format profiles to feedback format
7   !!
8   !!  ** Method  : Use of utilities from obs_fbm.
9   !!
10   !!  ** Action  :
11   !!
12   !!   Usage:
13   !!     corio2fb.exe outputfile inputfile1 inputfile2 ...
14   !!
15   !!   History :
16   !!        ! 2010 (K. Mogensen) Initial version
17   !!----------------------------------------------------------------------
18   USE obs_fbm
19   USE obs_prof_io
20   USE convmerge
21   IMPLICIT NONE
22   !
23   ! Command line arguments for output file and input files
24   !
25#ifndef NOIARGCPROTO
26   INTEGER,EXTERNAL :: iargc
27#endif
28   INTEGER :: nargs
29   CHARACTER(len=256) :: cdoutfile
30   CHARACTER(len=256),ALLOCATABLE :: cdinfile(:)
31   !
32   ! Input data
33   !
34   TYPE(obfbdata), POINTER :: coriof(:)
35   INTEGER :: ninfiles,ntotcorio,nmaxlev
36   INTEGER,ALLOCATABLE  :: iset(:),inum(:),iindex(:)
37   !
38   ! Output data
39   !
40   TYPE(obfbdata) :: fbdata
41   !
42   ! Loop variables
43   !
44   INTEGER :: ia,ii,ij
45   !
46   ! Get number of command line arguments
47   !
48   nargs=IARGC()
49   IF (nargs < 1) THEN
50      WRITE(*,'(A)')'Usage:'
51      WRITE(*,'(A)')'corio2fb outputfile inputfile1 inputfile2 ...'
52      CALL abort()
53   ENDIF
54   CALL getarg(1,cdoutfile)
55   !
56   ! Get input data
57   !
58   ALLOCATE( coriof(MAX(nargs-1,1)) )
59   ALLOCATE( cdinfile(nargs-1) )
60   ntotcorio = 0
61   ninfiles  = nargs - 1
62   DO ia=1,ninfiles
63      CALL getarg( ia + 1, cdinfile(ia) )
64      CALL read_coriofile( TRIM(cdinfile(ia)), coriof(ia), 6, .TRUE., .FALSE. )
65      WRITE(*,'(2A)')'File = ',TRIM(cdinfile(ia))
66      WRITE(*,'(A,I9,A)')'has',coriof(ia)%nobs,' profiles'
67      ntotcorio = ntotcorio + coriof(ia)%nobs
68      nmaxlev   = MAX( nmaxlev, coriof(ia)%nlev )
69   ENDDO
70   IF (ninfiles==0) THEN
71      CALL init_obfbdata( coriof(1) )
72      CALL alloc_obfbdata( coriof(1), 2, 0, 1, 0, 1, .FALSE. )
73      coriof(1)%cname(1) = 'POTM'
74      coriof(1)%cname(2) = 'PSAL'
75      coriof(1)%coblong(1) = 'Potential temperature'
76      coriof(1)%coblong(2) = 'Practical salinity'
77      coriof(1)%cobunit(1) = 'Degrees Celsius'
78      coriof(1)%cobunit(2) = 'PSU'
79      coriof(1)%cextname(1) = 'TEMP'
80      coriof(1)%cextlong(1) = 'Insitu temperature'
81      coriof(1)%cextunit(1) = 'Degrees Celsius'
82      coriof(1)%cdjuldref = '19500101000000'
83   ENDIF
84   WRITE(*,'(A,I8)') 'Total profiles : ',ntotcorio
85   !
86   ! Merge and output the data.
87   !
88   CALL conv_fbmerge( TRIM(cdoutfile), ninfiles, coriof )
89   
90END PROGRAM corio2fb
Note: See TracBrowser for help on using the repository browser.