Last change
on this file since 1009 was
880,
checked in by dubos, 5 years ago
|
devel : store cell bounds once, use them for XIOS later
|
File size:
1.2 KB
|
Rev | Line | |
---|
[880] | 1 | module write_field_vars_mod |
---|
| 2 | USE genmod |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | INTEGER,SAVE :: ncprec |
---|
| 6 | |
---|
| 7 | TYPE ncvar |
---|
| 8 | INTEGER :: size |
---|
| 9 | INTEGER,POINTER :: nc_id(:) |
---|
| 10 | INTEGER :: displ |
---|
| 11 | END TYPE ncvar |
---|
| 12 | |
---|
| 13 | INTEGER, PARAMETER :: MaxWriteField = 1000 |
---|
| 14 | INTEGER, DIMENSION(MaxWriteField),SAVE :: FieldId |
---|
| 15 | TYPE(ncvar), dimension(MaxWriteField),SAVE :: FieldVarId |
---|
| 16 | INTEGER, DIMENSION(MaxWriteField),SAVE :: FieldIndex |
---|
| 17 | CHARACTER(len=255), DIMENSION(MaxWriteField) :: FieldName |
---|
| 18 | |
---|
| 19 | INTEGER,SAVE :: NbField = 0 |
---|
| 20 | |
---|
| 21 | CONTAINS |
---|
| 22 | |
---|
| 23 | FUNCTION GetFieldIndex(name) |
---|
| 24 | integer :: GetFieldindex |
---|
| 25 | character(len=*) :: name |
---|
| 26 | |
---|
| 27 | character(len=255) :: TrueName |
---|
| 28 | integer :: i |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | TrueName=TRIM(ADJUSTL(name)) |
---|
| 32 | |
---|
| 33 | GetFieldIndex=-1 |
---|
| 34 | do i=1,NbField |
---|
| 35 | if (TrueName==FieldName(i)) then |
---|
| 36 | GetFieldIndex=i |
---|
| 37 | exit |
---|
| 38 | endif |
---|
| 39 | enddo |
---|
| 40 | END FUNCTION GetFieldIndex |
---|
| 41 | |
---|
| 42 | function int2str(int) |
---|
| 43 | integer, parameter :: MaxLen=10 |
---|
| 44 | integer,intent(in) :: int |
---|
| 45 | character(len=MaxLen) :: int2str |
---|
| 46 | logical :: flag |
---|
| 47 | integer :: i |
---|
| 48 | flag=.true. |
---|
| 49 | |
---|
| 50 | i=int |
---|
| 51 | |
---|
| 52 | int2str='' |
---|
| 53 | do while (flag) |
---|
| 54 | int2str=CHAR(MOD(i,10)+48)//int2str |
---|
| 55 | i=i/10 |
---|
| 56 | if (i==0) flag=.false. |
---|
| 57 | enddo |
---|
| 58 | end function int2str |
---|
| 59 | |
---|
| 60 | end module write_field_vars_mod |
---|
Note: See
TracBrowser
for help on using the repository browser.