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 branches/dev_2802_OBStools/NEMOGCM/TOOLS/OBSTOOLS – NEMO

source: branches/dev_2802_OBStools/NEMOGCM/TOOLS/OBSTOOLS/vel2fb.F90 @ 2893

Last change on this file since 2893 was 2893, checked in by djlea, 13 years ago

Adding obs tools to branch

File size: 1.8 KB
Line 
1PROGRAM vel2fb
2   USE obs_fbm
3   USE obs_vel_io
4   USE convmerge
5   IMPLICIT NONE
6   !
7   ! Command line arguments for output file and input files
8   !
9#ifndef NOIARGCPROTO
10   INTEGER,EXTERNAL :: iargc
11#endif
12   INTEGER :: nargs
13   CHARACTER(len=256) :: cdoutfile
14   CHARACTER(len=256),ALLOCATABLE :: cdinfile(:)
15   !
16   ! Input data
17   !
18   TYPE(obfbdata), POINTER :: velf(:)
19   INTEGER :: ninfiles,ntotvel,nmaxlev
20   INTEGER,ALLOCATABLE  :: iset(:),inum(:),iindex(:)
21   !
22   ! Output data
23   !
24   TYPE(obfbdata) :: fbdata
25   !
26   ! Loop variables
27   !
28   INTEGER :: ia,ii,ij
29   !
30   ! Get number of command line arguments
31   !
32   nargs=IARGC()
33   IF (nargs < 1) THEN
34      WRITE(*,'(A)')'Usage:'
35      WRITE(*,'(A)')'vel2fb outputfile inputfile1 inputfile2 ...'
36      CALL abort()
37   ENDIF
38   CALL getarg(1,cdoutfile)
39   !
40   ! Get input data
41   !
42   ALLOCATE( velf(MAX(nargs-1,1)) )
43   ALLOCATE( cdinfile(nargs-1) )
44   ntotvel = 0
45   ninfiles  = nargs - 1
46   DO ia = 1,ninfiles
47      CALL getarg( ia + 1, cdinfile(ia) )
48      CALL read_taondbc( TRIM(cdinfile(ia)), velf(ia), 6, .TRUE., .FALSE. )
49      WRITE(*,'(2A)')'File = ',TRIM(cdinfile(ia))
50      WRITE(*,'(A,I9,A)')'has',velf(ia)%nobs,' profiles'
51      ntotvel = ntotvel + velf(ia)%nobs
52      nmaxlev   = MAX( nmaxlev, velf(ia)%nlev )
53   ENDDO
54   IF (ninfiles==0) THEN
55      CALL init_obfbdata( velf(1) )
56      CALL alloc_obfbdata( velf(1), 2, 0, 1, 0, 1, .FALSE. )
57      velf(1)%cname(1) = 'UVEL'
58      velf(1)%cname(2) = 'VVEL'
59      velf(1)%coblong(1) = 'Zonal current'
60      velf(1)%coblong(2) = 'Meridional current'
61      velf(1)%cobunit(1) = 'Meters per second'
62      velf(1)%cobunit(2) = 'Meters per second'
63   ENDIF
64   WRITE(*,'(A,I8)') 'Total profiles : ',ntotvel
65   !
66   ! Merge and output the data.
67   !
68   CALL conv_fbmerge( TRIM(cdoutfile), ninfiles, velf )
69
70END PROGRAM vel2fb
Note: See TracBrowser for help on using the repository browser.