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.
vel2fb.F90 in utils/tools/OBSTOOLS/src – NEMO

source: utils/tools/OBSTOOLS/src/vel2fb.F90 @ 10841

Last change on this file since 10841 was 3002, checked in by djlea, 12 years ago

Update documentation for obstools and dataplot. Removal of dataplot code not needed. Addition of headers to some dataplot code. Addition of .exe to command example in obstools.

File size: 2.3 KB
Line 
1PROGRAM vel2fb
2   !!---------------------------------------------------------------------
3   !!
4   !!                     ** PROGRAM vel2fb **
5   !!
6   !!  ** Purpose : Convert TAO/PIRATA/RAMA currents to feedback format
7   !!
8   !!  ** Method  : Use of utilities from obs_fbm.
9   !!
10   !!  ** Action  :
11   !!
12   !!   Usage:
13   !!     vel2fb.exe outputfile inputfile1 inputfile2 ...
14   !!
15   !!   History :
16   !!        ! 2010 (K. Mogensen) Initial version
17   !!----------------------------------------------------------------------
18   USE obs_fbm
19   USE obs_vel_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 :: velf(:)
35   INTEGER :: ninfiles,ntotvel,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)')'vel2fb outputfile inputfile1 inputfile2 ...'
52      CALL abort()
53   ENDIF
54   CALL getarg(1,cdoutfile)
55   !
56   ! Get input data
57   !
58   ALLOCATE( velf(MAX(nargs-1,1)) )
59   ALLOCATE( cdinfile(nargs-1) )
60   ntotvel = 0
61   ninfiles  = nargs - 1
62   DO ia = 1,ninfiles
63      CALL getarg( ia + 1, cdinfile(ia) )
64      CALL read_taondbc( TRIM(cdinfile(ia)), velf(ia), 6, .TRUE., .FALSE. )
65      WRITE(*,'(2A)')'File = ',TRIM(cdinfile(ia))
66      WRITE(*,'(A,I9,A)')'has',velf(ia)%nobs,' profiles'
67      ntotvel = ntotvel + velf(ia)%nobs
68      nmaxlev   = MAX( nmaxlev, velf(ia)%nlev )
69   ENDDO
70   IF (ninfiles==0) THEN
71      CALL init_obfbdata( velf(1) )
72      CALL alloc_obfbdata( velf(1), 2, 0, 1, 0, 1, .FALSE. )
73      velf(1)%cname(1) = 'UVEL'
74      velf(1)%cname(2) = 'VVEL'
75      velf(1)%coblong(1) = 'Zonal current'
76      velf(1)%coblong(2) = 'Meridional current'
77      velf(1)%cobunit(1) = 'Meters per second'
78      velf(1)%cobunit(2) = 'Meters per second'
79   ENDIF
80   WRITE(*,'(A,I8)') 'Total profiles : ',ntotvel
81   !
82   ! Merge and output the data.
83   !
84   CALL conv_fbmerge( TRIM(cdoutfile), ninfiles, velf )
85
86END PROGRAM vel2fb
Note: See TracBrowser for help on using the repository browser.