libsim Versione 7.1.11
|
◆ vol7d_ana_vect_write_unit()
This method writes on a Fortran file unit the contents of the object this. The record can successively be read by the ::read_unit method. The method works both on formatted and unformatted files.
Definizione alla linea 565 del file vol7d_ana_class.F90. 566! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
567! authors:
568! Davide Cesari <dcesari@arpa.emr.it>
569! Paolo Patruno <ppatruno@arpa.emr.it>
570
571! This program is free software; you can redistribute it and/or
572! modify it under the terms of the GNU General Public License as
573! published by the Free Software Foundation; either version 2 of
574! the License, or (at your option) any later version.
575
576! This program is distributed in the hope that it will be useful,
577! but WITHOUT ANY WARRANTY; without even the implied warranty of
578! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
579! GNU General Public License for more details.
580
581! You should have received a copy of the GNU General Public License
582! along with this program. If not, see <http://www.gnu.org/licenses/>.
583#include "config.h"
584
593IMPLICIT NONE
594
596INTEGER,PARAMETER :: vol7d_ana_lenident=20
597
603 TYPE(geo_coord) :: coord
604 CHARACTER(len=vol7d_ana_lenident) :: ident
606
609
614 MODULE PROCEDURE vol7d_ana_init
615END INTERFACE
616
620 MODULE PROCEDURE vol7d_ana_delete
621END INTERFACE
622
626INTERFACE OPERATOR (==)
627 MODULE PROCEDURE vol7d_ana_eq
628END INTERFACE
629
633INTERFACE OPERATOR (/=)
634 MODULE PROCEDURE vol7d_ana_ne
635END INTERFACE
636
637
642INTERFACE OPERATOR (>)
643 MODULE PROCEDURE vol7d_ana_gt
644END INTERFACE
645
650INTERFACE OPERATOR (<)
651 MODULE PROCEDURE vol7d_ana_lt
652END INTERFACE
653
658INTERFACE OPERATOR (>=)
659 MODULE PROCEDURE vol7d_ana_ge
660END INTERFACE
661
666INTERFACE OPERATOR (<=)
667 MODULE PROCEDURE vol7d_ana_le
668END INTERFACE
669
670
673 MODULE PROCEDURE vol7d_ana_c_e
674END INTERFACE
675
679 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
680END INTERFACE
681
685 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
686END INTERFACE
687
688#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
689#define VOL7D_POLY_TYPES _ana
690#define ENABLE_SORT
691#include "array_utilities_pre.F90"
692
695 MODULE PROCEDURE to_char_ana
696END INTERFACE
697
700 MODULE PROCEDURE display_ana
701END INTERFACE
702
703CONTAINS
704
708SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
709TYPE(vol7d_ana),INTENT(INOUT) :: this
710REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
711REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
712CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
713INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
714INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
715
717IF (PRESENT(ident)) THEN
718 this%ident = ident
719ELSE
720 this%ident = cmiss
721ENDIF
722
723END SUBROUTINE vol7d_ana_init
724
725
727SUBROUTINE vol7d_ana_delete(this)
728TYPE(vol7d_ana),INTENT(INOUT) :: this
729
731this%ident = cmiss
732
733END SUBROUTINE vol7d_ana_delete
734
735
736
737character(len=80) function to_char_ana(this)
738
739TYPE(vol7d_ana),INTENT(in) :: this
740
741to_char_ana="ANA: "//&
744 t2c(this%ident,miss="Missing ident")
745
746return
747
748end function to_char_ana
749
750
751subroutine display_ana(this)
752
753TYPE(vol7d_ana),INTENT(in) :: this
754
755print*, trim(to_char(this))
756
757end subroutine display_ana
758
759
760ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
761TYPE(vol7d_ana),INTENT(IN) :: this, that
762LOGICAL :: res
763
764res = this%coord == that%coord .AND. this%ident == that%ident
765
766END FUNCTION vol7d_ana_eq
767
768
769ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
770TYPE(vol7d_ana),INTENT(IN) :: this, that
771LOGICAL :: res
772
773res = .NOT.(this == that)
774
775END FUNCTION vol7d_ana_ne
776
777
778ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
779TYPE(vol7d_ana),INTENT(IN) :: this, that
780LOGICAL :: res
781
782res = this%ident > that%ident
783
784if ( this%ident == that%ident) then
785 res =this%coord > that%coord
786end if
787
788END FUNCTION vol7d_ana_gt
789
790
791ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
792TYPE(vol7d_ana),INTENT(IN) :: this, that
793LOGICAL :: res
794
795res = .not. this < that
796
797END FUNCTION vol7d_ana_ge
798
799
800ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
801TYPE(vol7d_ana),INTENT(IN) :: this, that
802LOGICAL :: res
803
804res = this%ident < that%ident
805
806if ( this%ident == that%ident) then
807 res = this%coord < that%coord
808end if
809
810END FUNCTION vol7d_ana_lt
811
812
813ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
814TYPE(vol7d_ana),INTENT(IN) :: this, that
815LOGICAL :: res
816
817res = .not. (this > that)
818
819END FUNCTION vol7d_ana_le
820
821
822
823ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
824TYPE(vol7d_ana),INTENT(IN) :: this
825LOGICAL :: c_e
826c_e = this /= vol7d_ana_miss
827END FUNCTION vol7d_ana_c_e
828
829
834SUBROUTINE vol7d_ana_read_unit(this, unit)
835TYPE(vol7d_ana),INTENT(out) :: this
836INTEGER, INTENT(in) :: unit
837
838CALL vol7d_ana_vect_read_unit((/this/), unit)
839
840END SUBROUTINE vol7d_ana_read_unit
841
842
847SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
848TYPE(vol7d_ana) :: this(:)
849INTEGER, INTENT(in) :: unit
850
851CHARACTER(len=40) :: form
852
854INQUIRE(unit, form=form)
855IF (form == 'FORMATTED') THEN
856 READ(unit,'(A)')this(:)%ident
857ELSE
858 READ(unit)this(:)%ident
859ENDIF
860
861END SUBROUTINE vol7d_ana_vect_read_unit
862
863
868SUBROUTINE vol7d_ana_write_unit(this, unit)
869TYPE(vol7d_ana),INTENT(in) :: this
870INTEGER, INTENT(in) :: unit
871
872CALL vol7d_ana_vect_write_unit((/this/), unit)
873
874END SUBROUTINE vol7d_ana_write_unit
875
876
881SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
882TYPE(vol7d_ana),INTENT(in) :: this(:)
883INTEGER, INTENT(in) :: unit
884
885CHARACTER(len=40) :: form
886
888INQUIRE(unit, form=form)
889IF (form == 'FORMATTED') THEN
890 WRITE(unit,'(A)')this(:)%ident
891ELSE
892 WRITE(unit)this(:)%ident
893ENDIF
894
895END SUBROUTINE vol7d_ana_vect_write_unit
896
897
898#include "array_utilities_inc.F90"
899
900
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 |