ESMF_CFIOFileCreate
– Create a CFIO output file with meta data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_CFIO), | intent(inout) | :: | cfio |
a CFIO object |
||
integer, | intent(out), | optional | :: | rc |
Error return code: 0 all is well -1 Time increment is 0 -2 allocate memory error -3 Num of int/char/real elements and Cnt don’t match -12 error determining default precision -18 incorrect time increment -30 can’t open file -31 error from NF90_DEF_DIM -32 error from NF90_DEF_VAR (dimension variable) -33 error from NF90_PUT_ATT (dimension attribute) -34 error from NF90_DEF_VAR (variable) -35 error from NF90_PUT_ATT (variable attribute) -36 error from NF90_PUT_ATT (global attribute) -37 error from NF90_ENDDEF -38 error from NF90_PUT_VAR (dimension variable) -39 Num of real var elements and Cnt differ -55 error from NF90_REDEF (enter define mode) -56 error from NF90_ENDDEF (exit define mode) |
|
character(len=*), | intent(in), | optional | :: | expid |
Experiment ID |
|
character(len=*), | intent(in), | optional | :: | format |
GrADS or SDF |
subroutine ESMF_CFIOFileCreate (cfio, rc, expid, format) ! ! !ARGUMENTS: ! ! !INPUT PARAMETERS: ! type(ESMF_CFIO), intent(inout) :: cfio !! a CFIO object character(len=*), intent(in), OPTIONAL :: expid !! Experiment ID character(len=*), intent(in), OPTIONAL :: format !! GrADS or SDF ! ! !OUTPUT PARAMETERS: ! integer, intent(out), OPTIONAL :: rc !! Error return code: !! 0 all is well !! -1 Time increment is 0 !! -2 allocate memory error !! -3 Num of int/char/real elements and Cnt don't match !! -12 error determining default precision !! -18 incorrect time increment !! -30 can't open file !! -31 error from NF90_DEF_DIM !! -32 error from NF90_DEF_VAR (dimension variable) !! -33 error from NF90_PUT_ATT (dimension attribute) !! -34 error from NF90_DEF_VAR (variable) !! -35 error from NF90_PUT_ATT (variable attribute) !! -36 error from NF90_PUT_ATT (global attribute) !! -37 error from NF90_ENDDEF !! -38 error from NF90_PUT_VAR (dimension variable) !! -39 Num of real var elements and Cnt differ !! -55 error from NF90_REDEF (enter define mode) !! -56 error from NF90_ENDDEF (exit define mode) ! !------------------------------------------------------------------------------ integer :: rtcode character (len=16) :: myFormat myFormat = 'SDF' if (present(format)) then if (trim(ESMF_UtilStringUpperCase(format)) .eq. 'GRADS' ) then call ESMF_CFIOSet(cfio, format='GRADS') myFormat = 'GRADS' end if #if defined(HDFEOS) if (ESMF_UtilStringUpperCase(format)) .eq. 'EOS' ) then call ESMF_CFIOSet(cfio, format='EOS') myFormat = 'EOS' end if #endif end if select case (myFormat) case ('SDF') if (present(expid)) then call ESMF_CFIOSdfFileCreate (cfio, rtcode, expid) else call ESMF_CFIOSdfFileCreate (cfio, rtcode) end if if (present(rc)) rc = rtcode return #if defined(HDFEOS) case ('EOS') call ESMF_CFIOEOSFileCreate (cfio, rtcode) if (present(rc)) rc = rtcode return #endif end select end subroutine ESMF_CFIOFileCreate