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

source: branches/dev_2802_OBStools/NEMOGCM/TOOLS/OBSTOOLS/enact2fb.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: 2.0 KB
Line 
1PROGRAM enact2fb
2   USE obs_fbm
3   USE obs_prof_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 :: enactf(:)
19   INTEGER :: ninfiles,ntotenact,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)')'enact2fb outputfile inputfile1 inputfile2 ...'
36      CALL abort()
37   ENDIF
38   CALL getarg(1,cdoutfile)
39   !
40   ! Get input data
41   !
42   ALLOCATE( enactf(MAX(nargs-1,1)) )
43   ALLOCATE( cdinfile(nargs-1) )
44   ntotenact = 0
45   ninfiles  = nargs - 1
46   DO ia = 1,ninfiles
47      CALL getarg( ia + 1, cdinfile(ia) )
48      CALL read_enactfile( TRIM(cdinfile(ia)), enactf(ia), 6, .TRUE., .FALSE. )
49      WRITE(*,'(2A)')'File = ',TRIM(cdinfile(ia))
50      WRITE(*,'(A,I9,A)')'has',enactf(ia)%nobs,' profiles'
51      ntotenact = ntotenact + enactf(ia)%nobs
52      nmaxlev   = MAX( nmaxlev, enactf(ia)%nlev )
53   ENDDO
54   IF (ninfiles==0) THEN
55      CALL init_obfbdata( enactf(1) )
56      CALL alloc_obfbdata( enactf(1), 2, 0, 1, 0, 1, .FALSE. )
57      enactf(1)%cname(1) = 'POTM'
58      enactf(1)%cname(2) = 'PSAL'
59      enactf(1)%coblong(1) = 'Potential temperature'
60      enactf(1)%coblong(2) = 'Practical salinity'
61      enactf(1)%cobunit(1) = 'Degrees Celsius'
62      enactf(1)%cobunit(2) = 'PSU'
63      enactf(1)%cextname(1) = 'TEMP'
64      enactf(1)%cextlong(1) = 'Insitu temperature'
65      enactf(1)%cextunit(1) = 'Degrees Celsius'
66      enactf(1)%cdjuldref = '19500101000000'
67   ENDIF
68   WRITE(*,'(A,I8)') 'Total profiles : ',ntotenact
69   !
70   ! Merge and output the data.
71   !
72   CALL conv_fbmerge( TRIM(cdoutfile), ninfiles, enactf )
73
74END PROGRAM enact2fb
Note: See TracBrowser for help on using the repository browser.