As has been described extensively elsewhere, from an numerical analysis point of view, the file-consistency checks in the BCON m3_ck_*
routines are completely out to lunch; the subroutine bodies should be replaced by something that uses properly-robust consistency checking, i.e., something like the following:
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Get header data for CTM file 1 and create a list of species in the
c CTM files
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
IF ( .NOT. DESC3 ( CTM_FL_NAME( 1 ) ) ) THEN
MSG = 'Could not read DESC of ' // CTM_FL_NAME( 1 )
& // ' file'
CALL M3EXIT( PNAME, 0, 0, MSG, .TRUE. )
END IF
FTYPE1 = FTYPE3D
NCOLS1 = NCOLS3D
NROWS1 = NROWS3D
NLAYS1 = NLAYS3D
NTHIK1 = NTHIK3D
GDTYP1 = GDTYP3D
P_ALP1 = P_ALP3D
P_BET1 = P_BET3D
P_GAM1 = P_GAM3D
XORIG1 = XORIG3D
YORIG1 = YORIG3D
XCELL1 = XCELL3D
YCELL1 = YCELL3D
XCENT1 = XCENT3D
YCENT1 = YCENT3D
VGTYP1 = VGTYP3D
VGTOP1 = VGTOP3D
VGLVS1( 1:NLAYS1 ) = VGLVS3D( 1:NLAYS1 )
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Open the MET_CRO_3D_CRS file
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
IF ( .NOT. OPEN3( MET_CRO_3D_CRS, FSREAD3, PNAME ) ) THEN
MSG = 'Could not open ' // MET_CRO_3D_CRS // ' file'
CALL M3EXIT ( PNAME, 0, 0, MSG, XSTAT1 )
ELSE IF ( .NOT. DESC3( MET_CRO_3D_CRS ) ) THEN
MSG = 'Could not read DESC of file ' // MET_CRO_3D_CRS
CALL M3EXIT ( PNAME, 0, 0, MSG, XSTAT1 )
ELSE IF ( .NOT.FILCHK3( MET_CRO_3D_CRS, GRDDED3,
& NCOLS1, NROWS1, NLAYS1, NTHIK3D ) ) THEN
MSG = 'Inconsistent dimensions for ' // MET_CRO_3D_CRS
CALL M3EXIT ( PNAME, 0, 0, MSG, XSTAT1 )
ELSE IF ( .NOT.GRDCHK3( MET_CRO_3D_CRS,
& P_ALP1, P_BET1, P_GAM1, XCENT1, YCENT1,
& XORIG1, YORIG1, XCELL1, YCELL1,
& NLAYS1, VGTYP1, VGTOP1, VGLVS1 ) ) THEN
MSG = 'Inconsistent coord/grid for ' // MET_CRO_3D_CRS
CALL M3EXIT ( PNAME, 0, 0, MSG, XSTAT1 )
END IF
JDATE = SDATE
JTIME = STIME
RETURN
[By the way, the use of I/O API routine M3ERR
is improper; that routine was deprecated, replaced by routines M3WARN
and M3EXIT
for I/O API Prototype 0.5 in July 1992.]