libsim Versione 7.1.11
|
◆ vol7d_ana_read_unit()
This method reads from a Fortran file unit the contents of the object this. The record to be read must have been written with the ::write_unit method. The method works both on formatted and unformatted files.
Definizione alla linea 518 del file vol7d_ana_class.F90. 519! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
520! authors:
521! Davide Cesari <dcesari@arpa.emr.it>
522! Paolo Patruno <ppatruno@arpa.emr.it>
523
524! This program is free software; you can redistribute it and/or
525! modify it under the terms of the GNU General Public License as
526! published by the Free Software Foundation; either version 2 of
527! the License, or (at your option) any later version.
528
529! This program is distributed in the hope that it will be useful,
530! but WITHOUT ANY WARRANTY; without even the implied warranty of
531! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
532! GNU General Public License for more details.
533
534! You should have received a copy of the GNU General Public License
535! along with this program. If not, see <http://www.gnu.org/licenses/>.
536#include "config.h"
537
546IMPLICIT NONE
547
549INTEGER,PARAMETER :: vol7d_ana_lenident=20
550
556 TYPE(geo_coord) :: coord
557 CHARACTER(len=vol7d_ana_lenident) :: ident
559
562
567 MODULE PROCEDURE vol7d_ana_init
568END INTERFACE
569
573 MODULE PROCEDURE vol7d_ana_delete
574END INTERFACE
575
579INTERFACE OPERATOR (==)
580 MODULE PROCEDURE vol7d_ana_eq
581END INTERFACE
582
586INTERFACE OPERATOR (/=)
587 MODULE PROCEDURE vol7d_ana_ne
588END INTERFACE
589
590
595INTERFACE OPERATOR (>)
596 MODULE PROCEDURE vol7d_ana_gt
597END INTERFACE
598
603INTERFACE OPERATOR (<)
604 MODULE PROCEDURE vol7d_ana_lt
605END INTERFACE
606
611INTERFACE OPERATOR (>=)
612 MODULE PROCEDURE vol7d_ana_ge
613END INTERFACE
614
619INTERFACE OPERATOR (<=)
620 MODULE PROCEDURE vol7d_ana_le
621END INTERFACE
622
623
626 MODULE PROCEDURE vol7d_ana_c_e
627END INTERFACE
628
632 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
633END INTERFACE
634
638 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
639END INTERFACE
640
641#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
642#define VOL7D_POLY_TYPES _ana
643#define ENABLE_SORT
644#include "array_utilities_pre.F90"
645
648 MODULE PROCEDURE to_char_ana
649END INTERFACE
650
653 MODULE PROCEDURE display_ana
654END INTERFACE
655
656CONTAINS
657
661SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
662TYPE(vol7d_ana),INTENT(INOUT) :: this
663REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
664REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
665CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
666INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
667INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
668
670IF (PRESENT(ident)) THEN
671 this%ident = ident
672ELSE
673 this%ident = cmiss
674ENDIF
675
676END SUBROUTINE vol7d_ana_init
677
678
680SUBROUTINE vol7d_ana_delete(this)
681TYPE(vol7d_ana),INTENT(INOUT) :: this
682
684this%ident = cmiss
685
686END SUBROUTINE vol7d_ana_delete
687
688
689
690character(len=80) function to_char_ana(this)
691
692TYPE(vol7d_ana),INTENT(in) :: this
693
694to_char_ana="ANA: "//&
697 t2c(this%ident,miss="Missing ident")
698
699return
700
701end function to_char_ana
702
703
704subroutine display_ana(this)
705
706TYPE(vol7d_ana),INTENT(in) :: this
707
708print*, trim(to_char(this))
709
710end subroutine display_ana
711
712
713ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
714TYPE(vol7d_ana),INTENT(IN) :: this, that
715LOGICAL :: res
716
717res = this%coord == that%coord .AND. this%ident == that%ident
718
719END FUNCTION vol7d_ana_eq
720
721
722ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
723TYPE(vol7d_ana),INTENT(IN) :: this, that
724LOGICAL :: res
725
726res = .NOT.(this == that)
727
728END FUNCTION vol7d_ana_ne
729
730
731ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
732TYPE(vol7d_ana),INTENT(IN) :: this, that
733LOGICAL :: res
734
735res = this%ident > that%ident
736
737if ( this%ident == that%ident) then
738 res =this%coord > that%coord
739end if
740
741END FUNCTION vol7d_ana_gt
742
743
744ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
745TYPE(vol7d_ana),INTENT(IN) :: this, that
746LOGICAL :: res
747
748res = .not. this < that
749
750END FUNCTION vol7d_ana_ge
751
752
753ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
754TYPE(vol7d_ana),INTENT(IN) :: this, that
755LOGICAL :: res
756
757res = this%ident < that%ident
758
759if ( this%ident == that%ident) then
760 res = this%coord < that%coord
761end if
762
763END FUNCTION vol7d_ana_lt
764
765
766ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
767TYPE(vol7d_ana),INTENT(IN) :: this, that
768LOGICAL :: res
769
770res = .not. (this > that)
771
772END FUNCTION vol7d_ana_le
773
774
775
776ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
777TYPE(vol7d_ana),INTENT(IN) :: this
778LOGICAL :: c_e
779c_e = this /= vol7d_ana_miss
780END FUNCTION vol7d_ana_c_e
781
782
787SUBROUTINE vol7d_ana_read_unit(this, unit)
788TYPE(vol7d_ana),INTENT(out) :: this
789INTEGER, INTENT(in) :: unit
790
791CALL vol7d_ana_vect_read_unit((/this/), unit)
792
793END SUBROUTINE vol7d_ana_read_unit
794
795
800SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
801TYPE(vol7d_ana) :: this(:)
802INTEGER, INTENT(in) :: unit
803
804CHARACTER(len=40) :: form
805
807INQUIRE(unit, form=form)
808IF (form == 'FORMATTED') THEN
809 READ(unit,'(A)')this(:)%ident
810ELSE
811 READ(unit)this(:)%ident
812ENDIF
813
814END SUBROUTINE vol7d_ana_vect_read_unit
815
816
821SUBROUTINE vol7d_ana_write_unit(this, unit)
822TYPE(vol7d_ana),INTENT(in) :: this
823INTEGER, INTENT(in) :: unit
824
825CALL vol7d_ana_vect_write_unit((/this/), unit)
826
827END SUBROUTINE vol7d_ana_write_unit
828
829
834SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
835TYPE(vol7d_ana),INTENT(in) :: this(:)
836INTEGER, INTENT(in) :: unit
837
838CHARACTER(len=40) :: form
839
841INQUIRE(unit, form=form)
842IF (form == 'FORMATTED') THEN
843 WRITE(unit,'(A)')this(:)%ident
844ELSE
845 WRITE(unit)this(:)%ident
846ENDIF
847
848END SUBROUTINE vol7d_ana_vect_write_unit
849
850
851#include "array_utilities_inc.F90"
852
853
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:307 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:313 Classes for handling georeferenced sparse points in geographical corodinates. Definition: geo_coord_class.F90:222 Definition of constants to be used for declaring variables of a desired type. Definition: kinds.F90:251 Definitions of constants and functions for working with missing values. Definition: missing_values.f90:50 Classe per la gestione dell'anagrafica di stazioni meteo e affini. Definition: vol7d_ana_class.F90:218 Definisce l'anagrafica di una stazione. Definition: vol7d_ana_class.F90:231 |